Package org.jetlang.fibers

Examples of org.jetlang.fibers.PoolFiberFactory.create()


   
    public Downloader() {
        PoolFiberFactory f = new PoolFiberFactory(pool);
        //subscribe multiple fibers for parallel execution
        for(int i = 0, numThreads = 10; i < numThreads; i++) {
            Fiber fiber = f.create();
            fiber.start();
            fibers.add(fiber);
            channel.subscribe(fiber, new DownloadCallback());
        }
    }
View Full Code Here


    public Downloader() {
        PoolFiberFactory f = new PoolFiberFactory(pool);
        //subscribe multiple fibers for parallel execution
        for(int i = 0, numThreads = 10; i < numThreads; i++) {
            Fiber fiber = f.create();
            fiber.start();
            fibers.add(fiber);
            channel.subscribe(fiber, new DownloadCallback());
        }
    }
View Full Code Here

  protected void configure() {
    install(new StateModule(timeout));

    PoolFiberFactory fiberFactory = new PoolFiberFactory(executor);

    Fiber raftFiber = fiberFactory.create(new BatchExecutor());
    raftFiber.start();
    bind(Fiber.class).annotatedWith(RaftExecutor.class).toInstance(raftFiber);

    Fiber stateMachineFiber = fiberFactory.create(new BatchExecutor());
    stateMachineFiber.start();
View Full Code Here

    Fiber raftFiber = fiberFactory.create(new BatchExecutor());
    raftFiber.start();
    bind(Fiber.class).annotatedWith(RaftExecutor.class).toInstance(raftFiber);

    Fiber stateMachineFiber = fiberFactory.create(new BatchExecutor());
    stateMachineFiber.start();

    install(new LogModule(logDir, stateMachine, stateMachineFiber));

    bind(ClusterConfig.class).toInstance(config);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.