views:

58

answers:

1

it seems threads.blockingCallFromThread keeps blocking even when the reactor stops. is there any way to un-block it? the deferred that it is blocking on relies on an RPC coming from the other end, and that definitely won't come in with the reactor stopped.

+1  A: 

It blocks until the Deferred fires. If you want it to unblock, fire the Deferred. If you're stopping your application and stopping the reactor, then you might want to fire the Deferred before you do that. You probably want to fire it with a Failure since presumably you haven't been able to come up with a successful result. You can install reactor shutdown hooks to run code when the reactor is about to stop, either using a custom Service or reactor.addSystemEventTrigger.

Jean-Paul Calderone
ah that makes sense. when I create the deferred, I can add an event to make it fail before shutdown. it seems like this should be a default option somewhere..
Claudiu