asynqueue.util.CallRunner(object)
class documentation
Part of asynqueue.util
(View In Hierarchy)
I'm used by threads.ThreadLooper
and process.ProcessUniverse
.
Parameters | raw | Set True to return raw iterators by default instead of doing
iteration magic. |
callStats | Set True to accumulate a list of callTimes for each
call. Caution: Can get big with lots of calls! | |
reactor | Set to an instance of twisted.internet.reactor to have calls
run in the reactor. |
Method | __init__ | CallRunner(raw=False, callStats=False, reactor=None) |
Method | __call__ | Does the f-args-kw call in callTuple to get a 2-tuple containing the status of the call and its result: |
def
__init__(self, raw=False, callStats=False, reactor=None):
CallRunner(raw=False, callStats=False, reactor=None)
def
__call__(self, callTuple):
Does the f-args-kw call in callTuple to get a 2-tuple containing the status of the call and its result:
- e: An exception was raised; the result is a pretty-printed traceback string.
- r: Ran fine, the result is the return value of the call.
- i: Ran fine, but the result is an iterable other than a standard Python one.
Honors the raw option to return iterators as-is if desired. The called function never sees that keyword.