T - This type parameter specifies the type of data object which may be
passed into the threadable task.
U - This type parameter specifies the type of data object which will be
passed back by the threadable task on completion.
public interface Threadable<T,U>
Defines the interface to a threadable task object. Threadable task objects
can be submitted to the reactor in order to run in a separate thread. This is
useful for executing code which contains blocking calls within the Reaction
framework. On submitting a threadable task object to the reactor using the
runThread method on the
Reactor interface, an object implementing the Deferred
interface is returned which will be used to forward the results generated by
the run method on completion.
Runs a threadable task in the context of a new thread. On submitting an
object implementing this interface for threaded execution, this method will
be called by the reactor in the context of a new thread. On normal
completion it will return a data object which will be passed as the
callback parameter to the deferred callback chain. Alternatively, if an
exception is thrown this will be passed as the errback parameter to the
error callback chain.
data - This is the input data object which is provided when submitting
the threadable task object to the reactor.
Returns an output data object which will be passed to the deferred
callback chain as the
java.lang.Exception - On an exception, the exception object is passed to the deferred
error callback chain as the