Part of twisted.flow.stage View Source View In Hierarchy
Converts a single-thread push interface into a pull interface.
Once this stage is constructed, its result, errback, and finish member variables may be called by a producer. The results of which can be obtained by yielding the Callback and then calling next().
For example:
source = flow.Callback()
reactor.callLater(0, lambda: source.result("one"))
reactor.callLater(.5, lambda: source.result("two"))
reactor.callLater(1, lambda: source.finish())
printFlow(source)
Split Table into Classes Show Methods in One Table
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 208 | Class | Instruction | Undocumented |
| 213 | Method | __init__ | Undocumented |
| 217 | Method | result | called by the producer to indicate a successful result |
| 221 | Method | finish | called by producer to indicate successful stream completion |
| 226 | Method | errback | called by the producer in case of Failure |
| 230 | Method | _yield | executed during a yield statement by previous stage |
Inherited from Stage:
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 170 | Method | __iter__ | Undocumented |
| 173 | Method | next | return current result |
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 213 | Method | __init__ | Undocumented |
| 170 | Method | __iter__ | Undocumented |
| 226 | Method | errback | called by the producer in case of Failure |
| 221 | Method | finish | called by producer to indicate successful stream completion |
| 208 | Class | Instruction | Undocumented |
| 173 | Method | next | return current result |
| 217 | Method | result | called by the producer to indicate a successful result |
| 230 | Method | _yield | executed during a yield statement by previous stage |
executed during a yield statement by previous stage
This method is private within the scope of the flow module, it is used by one stage in the flow to ask a subsequent stage to produce its value. The result of the yield is then stored in self.result and is an instance of Failure if a problem occurred.