5.9 Execution Context

The processing of deferrable callback chains is always carried out in the context of the reactor thread. Callbacks will only be processed once a terminal deferrable has been added to the callback chain and a call to either the callback or the errback method is made. Note that a call to the callback or errback method must be made exactly once per deferred event object, and any additional attempts to call these methods will result in a runtime exception of type DeferredTriggeredException being thrown.

There is no restriction on the ordering of calls to the callback, errback and addDeferrable methods - so deferrable callback handlers can actually be added to the callback chain after a call to the callback or errback method has already been made, provided the callback chain has not already been terminated. Calls to the callback, errback and addDeferrable methods may be made from any thread context since deferred event objects are thread safe.