最佳答案
PoolFiber 和 ThreadFiber 的使用几乎相同。唯一的区别是线程池需要初始化并用于创建每个 PoolFiber。
// create java thread pool.
ExecutorService pool = Executors.newCachedThreadPool();
//initialize factory with backing pool
PoolFiberFactory fiberFactory = new PoolFiberFactory(pool);
Fiber fiber = fiberFactory.create();
fiber.start();
//use fiber for normal publishing and subscribing.
关于java - Jetlang PoolFiber 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/286848/