Rewrite deferred documentation
| Newsgroups | gmane.comp.python.twisted.bugs |
|---|---|
| Message-ID | <[email protected]> |
New submission from ezyang <None>:
There seems to be a general consensus (on #twisted at least), that the old documentation on Deferreds kind of sucks. The planned new outline is:
- Synchronous to Asynchronous: The Method to the Madness
- Convert synchronous code to asynchronous code
- Why asynchronous?
- Deferred
- Basic operation
- Convenience primitives (succeed, fail, execute, maybeDeferred)
- Callback/Errback chaining
- Timeouts
- Composing deferreds
- DeferredList/gatherResults
- chainDeferred
- Advanced topics
- Deferred asynchronous primitives
- Sugar syntax
One of the ideas behind the new documentation is that there is a mapping between synchronous code and asynchronous code, and as such copious examples to explain this are to be provided. In particular, errbacks are simply a userland reimplementation of exception handling.
I expect the hardest pieces to explain will be:
1. The asynchronous paradigm shift
2. Callback/Errback chaining (in which the method names are totally misleading; I'm going to take a "please ignore the abstraction barrier" approach to this one)
3. Deferred composition
----------
Type : enhancement
Component: core
Keywords :
Priority : normal
Nosy :
----------
http://twistedmatrix.com/trac/ticket/3943