twisted.internet.threads.deferToThreadPool(reactor, threadpool, f, *args, **kwargs)
function documentationtwisted.internet.threads
View Source
Call the function f
using a thread from the given threadpool and return the result as a Deferred.
This function is only used by client code which is maintaining its own threadpool. To run a function in the reactor's threadpool, use deferToThread
.
Parameters | reactor | The reactor in whose main thread the Deferred will be invoked. |
threadpool | An object which supports the callInThreadWithCallback method of twisted.python.threadpool.ThreadPool . | |
f | The function to call. | |
*args | positional arguments to pass to f. | |
**kwargs | keyword arguments to pass to f. | |
Returns | A Deferred which fires a callback with the result of f, or an errback with a twisted.python.failure.Failure if f throws an exception. |
Function | onResult | Undocumented |