Package groovyx.gpars.actor

Examples of groovyx.gpars.actor.Actor.start()


     * @return A new instance of ReactiveEventBasedThread
     */
    public final Actor reactor(@DelegatesTo(Actor.class) final Closure code) {
        final Actor actor = new ReactiveActor(code);
        actor.setParallelGroup(this);
        actor.start();
        return actor;
    }

    /**
     * Creates a reactor around the supplied code, which will cooperate in thread sharing with other actors sharing the same thread pool
View Full Code Here


@SuppressWarnings({"MagicNumber"})
public class StatefulActorTest {
    @Test
    public void testStatefulActor() throws Exception {
        final Actor actor = new MyActor();
        actor.start();
        actor.send("Hello");
        actor.send("Hello again");
        actor.send(10);

        actor.send("Bye");
View Full Code Here

            // Create and chain actors (backwards - the lastActor will be first)
            for (int i = 0; i < ACTORS; i++) {
                final Actor actor = new MessagePassingActor(lastActor, cdl);
                actor.setParallelGroup(group);
                lastActor = actor;
                actor.start();
            }

            for (int i = 0; i < MESSAGES; i++) {
                lastActor.send("Hi");
            }
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.