Home | Trees | Index | Help |
|
---|
Package twisted :: Package internet :: Module defer |
|
Support for results that aren't immediately available.
API Stability: stable
Maintainer: Glyph LefkowitzClasses | |
---|---|
_nothing |
|
Deferred |
This is a callback which will be put off until later. |
DeferredList |
I combine a group of deferreds into one callback. |
Exceptions | |
---|---|
AlreadyArmedError |
|
AlreadyCalledError |
|
TimeoutError |
Function Summary | |
---|---|
_parseDListResult(l,
fireOnOneErrback)
| |
Create a deferred from a callable and arguments. | |
Deferred
|
Return a Deferred that has already had '.errback(result)' called. |
Returns list with result of given Deferreds. | |
logError(err)
| |
Deferred
|
Invoke a function that may or may not return a deferred. |
passthru(arg)
| |
Deferred
|
Return a Deferred that has already had '.callback(result)' called. |
timeout(deferred)
|
Variable Summary | |
---|---|
int |
FAILURE = 0 |
int |
SUCCESS = 1 |
Function Details |
---|
execute(callable, *args, **kw)Create a deferred from a callable and arguments. Call the given function with the given arguments. Return a deferred which has been fired with its callback as the result of that invocation or its errback with a Failure for the exception thrown. |
fail(result=<class twisted.internet.defer._nothing at 0x82a9674>)Return a Deferred that has already had '.errback(result)' called. Seesucceed 's docstring for rationale.
|
gatherResults(deferredList, fireOnOneErrback=0)Returns list with result of given Deferreds. This builds onDeferredList but is useful since you
don't need to parse the result for success/failure.
|
maybeDeferred(f, *args, **kw)Invoke a function that may or may not return a deferred. Call the given function with the given arguments. If the returned object is aDeferred , return it. If the returned object is
a Failure , wrap it with fail and return it.
Otherwise, wrap it in succeed and return it. If an
exception is raised, convert it to a Failure , wrap it in
fail , and then return it.
|
succeed(result)Return a Deferred that has already had '.callback(result)' called. This is useful when you're writing synchronous code to an asynchronous interface: i.e., some code is calling you expecting a Deferred result, but you don't actually need to do anything asynchronous. Just return defer.succeed(theResult). Seefail for a version of this function that
uses a failing Deferred rather than a successful one.
|
Variable Details |
---|
FAILURE
|
SUCCESS
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat May 15 20:08:48 2004 | http://epydoc.sf.net |