t.i.threads : module documentation

Part of twisted.internet View Source

Extended thread dispatching support.

For basic support see reactor threading API docs.

Maintainer: Itamar Shtull-Trauring
Function deferToThread Run function in thread and return result as Deferred.
Function callMultipleInThread Run a list of functions in the same thread.
Function blockingCallFromThread Run a function in the reactor from a thread, and wait for the result synchronously, i.e. until the callback chain returned by the function get a result.
Function _putResultInDeferred Run a function and give results to a Deferred.
Function _runMultiple Run a list of functions.
def _putResultInDeferred(deferred, f, args, kwargs): (source)
Run a function and give results to a Deferred.
def deferToThread(f, *args, **kwargs): (source)
Run function in thread and return result as Deferred.
def _runMultiple(tupleList): (source)
Run a list of functions.
def callMultipleInThread(tupleList): (source)

Run a list of functions in the same thread.

tupleList should be a list of (function, argsList, kwargsDict) tuples.
def blockingCallFromThread(reactor, f, *a, **kw): (source)
Run a function in the reactor from a thread, and wait for the result synchronously, i.e. until the callback chain returned by the function get a result.
ParametersreactorThe IReactorThreads provider which will be used to schedule the function call.
fthe callable to run in the reactor thread (type: any callable. )
athe arguments to pass to f.
kwthe keyword arguments to pass to f.
Returnsthe result of the callback chain.
Raisesany error raised during the callback chain.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.