t.i.task : module documentation

Part of twisted.internet View Source

Scheduling utility methods and classes.
AuthorJp Calderone
Class LoopingCall Call a function repeatedly.
Class SchedulerError No summary
Class SchedulerStopped The operation could not complete because the scheduler was stopped in progress or was already stopped.
Class TaskFinished The operation could not complete because the task was already completed, stopped, encountered an error or otherwise permanently stopped running.
Class TaskDone The operation could not complete because the task was already completed.
Class TaskStopped The operation could not complete because the task was stopped.
Class TaskFailed The operation could not complete because the task died with an unhandled error.
Class NotPaused This exception is raised when a task is resumed which was not previously paused.
Class CooperativeTask A CooperativeTask is a task object inside a Cooperator, which can be paused, resumed, and stopped. It can also have its completion (or termination) monitored.
Class Cooperator Cooperative task scheduler.
Function coiterate Cooperatively iterate over the given iterator, dividing runtime between it and all other iterators which have been passed to this function and not yet exhausted.
Function cooperate Start running the given iterator as a long-running cooperative task, by calling next() on it as a periodic timed event.
Class Clock Provide a deterministic, easily-controlled implementation of IReactorTime.callLater. This is commonly useful for writing deterministic unit tests for code which schedules events using this API.
Function deferLater Call the given function after a certain period of time has passed.
Class _Timer Undocumented
Function _defaultScheduler Undocumented
def _defaultScheduler(x): (source)
Undocumented
def coiterate(iterator): (source)
Cooperatively iterate over the given iterator, dividing runtime between it and all other iterators which have been passed to this function and not yet exhausted.
def cooperate(iterator): (source)
Start running the given iterator as a long-running cooperative task, by calling next() on it as a periodic timed event.
Parametersiteratorthe iterator to invoke.
Returnsa CooperativeTask object representing this task.
def deferLater(clock, delay, callable, *args, **kw): (source)
Call the given function after a certain period of time has passed.
ParametersclockThe object which will be used to schedule the delayed call. (type: IReactorTime provider)
delayThe number of seconds to wait before calling the function. (type: float or int)
callableThe object to call after the delay.
*argsThe positional arguments to pass to callable.
**kwThe keyword arguments to pass to callable.
ReturnsA deferred that fires with the result of the callable when the specified time has elapsed. (type: defer.Deferred)
API Documentation for Twisted, generated by pydoctor at 2012-06-04 17:20:01.