Part of canonical
| Module | loggingsupport | Integration between the normal Launchpad logging and Twisted's. |
| Module | processmonitor | Helpers for running a child process and communicating things about it. |
| Module | task | Tools for managing long-running or difficult tasks with Twisted. |
| Package | tests | No package docstring; 4/4 modules documented |
From the __init__.py module:
| Function | defer_to_thread | Run in a thread and return a Deferred that fires when done. |
| Function | extract_result | Extract the result from a fired deferred. |
| Function | gatherResults | Returns list with result of given Deferreds. |
| Function | suppress_stderr | Deferred friendly decorator that suppresses output from a function. |
Returns list with result of given Deferreds.
This differs from Twisted's `defer.gatherResults` in two ways.
1. It fires the actual first error that occurs, rather than wrapping
it in a `defer.FirstError`.
2. All errors apart from the first are consumed. (i.e. `consumeErrors`
is True.)
:type deferredList: list of `defer.Deferred`s.
:return: `defer.Deferred`.
It can happen that you have an API that returns Deferreds for compatibility with Twisted code, but is in fact synchronous, i.e. the Deferreds it returns have always fired by the time it returns. In this case, you can use this function to convert the result back into the usual form for a synchronous API, i.e. the result itself or a raised exception.
It would be very bad form to use this as some way of checking if a Deferred has fired.