Package co.paralleluniverse.actors.behaviors

Examples of co.paralleluniverse.actors.behaviors.SupervisorActor


    /**
     * Main loop: loops over all spaceships and initiates each spaceship's actions. Simulates an IO thread receiving commands over the net.
     */
    private void run() throws Exception {
        final Supervisor sup = new SupervisorActor(SupervisorActor.RestartStrategy.ONE_FOR_ONE) {
            @Override
            protected void init() throws InterruptedException, SuspendExecution {
                for (int i = 0; i < N; i++)
                    addChild(new Supervisor.ChildSpec("ship-" + i, Supervisor.ChildMode.PERMANENT, 5, 1, TimeUnit.SECONDS, 3, ActorSpec.of(Spaceship.class, Spaceships.this, i, phaser)));
            }
View Full Code Here

TOP

Related Classes of co.paralleluniverse.actors.behaviors.SupervisorActor

Copyright © 2018 www.massapicom. 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.