asynqueue.tasks.Task(object)
class documentation
Part of asynqueue.tasks
(View In Hierarchy)
I represent a task that has been dispatched to a queue for running with a given scheduling niceness.
I generate a Deferred
that you fire by calling either my callback
or errback
with a
result or failure, respectively, when the the task is finally run and its
result is obtained. You can call the deferred's versions of those methods
directly, but my versions deal with things like repeated callbacks, which
happen sometimes with task timeouts.
Instance Variable | d | A Deferred to the eventual result of the task. |
Instance Variable | series | A hashable object identifying the series of which this task is a part. |
Method | __init__ | Undocumented |
Method | startTimer | Undocumented |
Method | addCallback | Undocumented |
Method | callback | Undocumented |
Method | errback | Undocumented |
Method | timedout | Undocumented |
Method | reset | Undocumented |
Method | rush | Undocumented |
Method | relax | Undocumented |
Method | copy | Returns a functional copy of me with all necessary attributes and callbacks pre-added. |
Method | __repr__ | Gives me an informative string representation. |
Method | __lt__ | Numeric comparisons between tasks are based on their priority, with higher (lower-numbered) priorities being considered 'less' and thus sorted first. |
Method | __gt__ | Numeric comparisons between tasks are based on their priority, with higher (lower-numbered) priorities being considered 'less' and thus sorted first. |
Method | __eq__ | A task can never have the same priority as a None object,
which has the worst priority of anything. |
Method | __hash__ | This was necessary to make Python 3 happy for some reason. |
Method | _cancelTimeout | Undocumented |
Returns a functional copy of me with all necessary attributes and callbacks pre-added.
Numeric comparisons between tasks are based on their priority, with higher (lower-numbered) priorities being considered 'less' and thus sorted first.
A task will always have a higher priority, i.e., be comparatively
less, than a None
object, which is used as a shutdown
signal instead of a task.
Numeric comparisons between tasks are based on their priority, with higher (lower-numbered) priorities being considered 'less' and thus sorted first.
A task can never greater (i.e., worse) priority than a None
object, which has the worst priority of anything.