Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify how a message can be sent to an actor from outside an actor? #1

Open
nobeh opened this issue May 23, 2014 · 1 comment
Open
Assignees
Milestone

Comments

@nobeh
Copy link
Member

nobeh commented May 23, 2014

Currently, to accomplish this, the user programmer needs to take a twisted way to create an instance of Envelope and then route using the available context instance. This should be simplified.

@nobeh nobeh added bug labels May 23, 2014
@nobeh nobeh added this to the v1.0 milestone May 23, 2014
nobeh added a commit that referenced this issue May 23, 2014
A method inside Context that uses Actor.NOBODY as the sender.
@nobeh nobeh self-assigned this May 23, 2014
@nobeh
Copy link
Member Author

nobeh commented May 23, 2014

An example provided in ContextTest:

    static class MyActor implements Actor {
        private static final long serialVersionUID = 1L;

        public Double doIt(Integer x) {
            return Math.random() * x;
        }
    }

    @Test
    public void tesetSendMessageOutsideActor() throws Exception {
        LocalContext context = new LocalContext();
        final MyActor actor = new MyActor();
        final Actor ref = context.newActor("myActor", actor);
        Callable<Double> message = () -> actor.doIt(10);
        Future<?> result = context.send(ref, message);
        assertNotNull(result);
        assertNotNull(result.get());
        assertEquals(Double.class, result.get().getClass());
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant