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 twisted.internet.defer.Deferred to fire in the main reactor thread using .callFromThread. Note that onResult is called inside the separate thread, not inside the reactor thread.

ParametersonResulta 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.

funccallable object to be called in separate thread
argspositional arguments to be passed to func
kwkeyword arguments to be passed to func
Function inContext Undocumented
def inContext(): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2020-03-20 23:54:06.