Call a callable object in a separate thread and call onResult with the
return value, or a twisted.python.failure.Failure
if the callable raises an exception.

The callable is allowed to block, but the onResult function must not
block and should perform as little work as possible.

A typical action for onResult for a threadpool used with a Twisted
reactor would be to schedule a Deferred to fire in the main reactor thread
using .callFromThread. Note that onResult is called inside
the separate thread, not inside the reactor thread.

Parameters

onResult

a callable with the signature (success, result). If the callable returns
normally, onResult is called with (True, result) where result is the return
value of the callable. If the callable throws an exception, onResult is
called with (False, failure).

Optionally, onResult may be None, in which case it is not called at
all.