Package co.paralleluniverse.actors

Examples of co.paralleluniverse.actors.ActorRef.send()


        @Override
        public void send(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
            if (a != null)
                a.send(message);
        }

        @Override
        public void sendSync(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
View Full Code Here


        @Override
        public boolean send(Message message, long timeout, TimeUnit unit) throws SuspendExecution, InterruptedException {
            final ActorRef a = getActor();
            if (a != null)
                return a.send(message, timeout, unit);
            return true;
        }

        @Override
        public boolean send(Message msg, Timeout timeout) throws SuspendExecution, InterruptedException {
View Full Code Here

        @Override
        public void send(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
            if (a != null)
                a.send(message);
        }

        @Override
        public void sendSync(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
View Full Code Here

                    Strand.sleep(3000);
                }
                System.out.println("pong is " + pong);

                for (int i = 0; i < 3; i++) {
                    pong.send(new Message(self(), PING));
                    Message msg = receive();
                    System.out.println("ping received " + msg.type);
                }

                pong.send(new Message(null, FINISHED));
View Full Code Here

                    pong.send(new Message(self(), PING));
                    Message msg = receive();
                    System.out.println("ping received " + msg.type);
                }

                pong.send(new Message(null, FINISHED));
                return null;
            }
        }.spawn();
        LocalActor.join(ping);
        System.out.println("finished ping");
View Full Code Here

                    System.out.println("Finding pong...");
                    pong = ActorRegistry.getActor("pong");
                    System.out.println("pong is " + pong);

                    for (int i = 0; i < 3; i++) {
                        pong.send(new Message(self(), PING));
                        Message msg = receive();
                        System.out.println("ping received " + msg.type);
                    }

                    pong.send(new Message(null, FINISHED));
View Full Code Here

                        pong.send(new Message(self(), PING));
                        Message msg = receive();
                        System.out.println("ping received " + msg.type);
                    }

                    pong.send(new Message(null, FINISHED));
                    return null;
                }
            }.spawn();
            LocalActor.join(ping);
            System.out.println("finished ping");
View Full Code Here

        @Override
        public void send(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
            if (a != null)
                a.send(message);
        }

        @Override
        public void sendSync(Message message) throws SuspendExecution {
            final ActorRef a = getActor();
View Full Code Here

        @Override
        public boolean send(Message message, long timeout, TimeUnit unit) throws SuspendExecution, InterruptedException {
            final ActorRef a = getActor();
            if (a != null)
                return a.send(message, timeout, unit);
            return true;
        }

        @Override
        public boolean send(Message msg, Timeout timeout) throws SuspendExecution, InterruptedException {
View Full Code Here

                    Strand.sleep(3000);
                }
                System.out.println("pong is " + pong);

                for (int i = 0; i < 3; i++) {
                    pong.send(new Message(self(), PING));
                    Message msg = receive();
                    System.out.println("ping received " + msg.type);
                }

                pong.send(new Message(null, FINISHED));
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.