Hi all, I create a Future in an actor's onReceive method, and use 
onComplete to trigger a side-effect when that future completes, like this:


public void onReceive(Object message) throws Exception {
    final ActorRef sender = sender();

    Future f = ...;
    f.onComplete(new OnComplete() {
        @Override
        public void onComplete(Throwable throwable, Object object) throws 
Throwable {
            // Can use final sender here.
            // What actor methods are allowed here?
        }

    }, context().dispatcher());
}


It's clear that one must not modify the actor's state from within the 
onComplete callback, and it's clear that one must use the self() and 
sender() methods outside the callback and pass it into the onComplete as 
finals. But what other actor methods are allowed inside the onComplete 
method? Is it ok to use context(), eg?

Thanks.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to