code_junkie

Jetlang PoolFiber sample

Nov 12th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. // create java thread pool.
  2. ExecutorService pool = Executors.newCachedThreadPool();
  3. //initialize factory with backing pool
  4. PoolFiberFactory fiberFactory = new PoolFiberFactory(pool);
  5. Fiber fiber = fiberFactory.create();
  6. fiber.start();
  7. //use fiber for normal publishing and subscribing.
Add Comment
Please, Sign In to add comment