Hi,
I have been trying to use the Patterns.gracefulStop to stop an actor
gracefully. I know my internal actor is stopped by verifying the postStop
method is invoked.
However, the future is not returning true and is held until timeout.
Is there a bug?
Here is my code:
public class TestActor extends UntypedActor {
private final Logger log = LoggerFactory.getLogger(TestActor.class);
final ActorRef target;
public TestActor( ActorRef target ) {
this.target = target;
}
@Override
public void postStop() throws Exception {
super.postStop();
log.info("Actor stopped...");
}
@Override
public void onReceive( Object msg ) {
if ( msg == Command.STOP_PROCESSING ) {
log.info("Stopping actor...");
getContext().stop( getSelf() );
} else {
unhandled(msg);
}
}
}
Code to stop:
Future< Boolean > stopped = Patterns.gracefulStop( actorRef,
Duration.create( 5, TimeUnit.SECONDS ), Command.STOP_PROCESSING );
Await.result( stopped, Duration.Inf() );
--
>>>>>>>>>> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.