twisted.internet.threads.deferToThread(f, *args, **kwargs)
function documentationtwisted.internet.threads
View Source
Run a function in a thread and return the result as a Deferred.
Parameters | 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. |