Part of twisted.internet.task View Source View In Hierarchy
CooperativeTaskis a task object inside a
Cooperator, which can be paused, resumed, and stopped. It can also have its completion (or termination) monitored.
|Method||__init__||A private constructor: to create a new
|Method||resume||Resume processing of a paused
|Method||stop||Stop further processing of this task.|
|Instance Variable||_iterator||the iterator to iterate when this
|Instance Variable||_deferreds||the list of
|Instance Variable||_pauseCount||the number of times that this
|Instance Variable||_completionState||The completion-state of this
|Method||_checkFinish||If this task has been stopped, raise the appropriate subclass of
|Method||_oneWorkUnit||Perform one unit of work for this task, retrieving one item from its
iterator, stopping if there are no further items in the iterator, and
pausing if the result was a
CooperativeTaskis asked to do work.
Noneif the task is not yet completed, an instance of
stopwas called to stop this task early, of
TaskFailedif the application code in the iterator raised an exception which caused it to terminate, and of
TaskDoneif it terminated normally via raising
defer.Deferrednotification of when this task is complete.
|deferredResult||the result to fire all the deferreds with.|
|Raises||TaskFinished||if this |