Current Path : /usr/lib/python2.7/dist-packages/twisted/internet/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/internet/threads.pyc |
[XMc @ su d Z d d l Z d d l m Z d d l m Z d Z d Z d Z d Z d Z d d d d g Z d S( s} Extended thread dispatching support. For basic support see reactor threading API docs. Maintainer: Itamar Shtull-Trauring iN( t failure( t deferc s8 t j f d } | j | | | | S( s6 Call the function C{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 C{deferToThread}. @param reactor: The reactor in whose main thread the Deferred will be invoked. @param threadpool: An object which supports the C{callInThreadWithCallback} method of C{twisted.python.threadpool.ThreadPool}. @param f: The function to call. @param *args: positional arguments to pass to f. @param **kwargs: keyword arguments to pass to f. @return: A Deferred which fires a callback with the result of f, or an errback with a L{twisted.python.failure.Failure} if f throws an exception. c s3 | r j j | n j j | d S( N( t callFromThreadt callbackt errback( t successt result( t dt reactor( s<