What a task yields control to
IProcedure objects running in a task yield ITaskSwitch objects to
control the task's flow and co-operation.
In addition to PEAK-supplied event sources like Value, Semaphore, and
Condition, generator-iterators and other IProcedure objects are also
adaptable to ITaskSwitch, thus allowing one to e.g.
yield someGenerator(someArgs) in a task. This allows the nested
generator to run as the next procedure for the task.
|
Methods
|
|
nextAction
|
|
|
nextAction
|
nextAction ( task=None, state=None )
Return true if task should continue
If supplied, task and state are an ITask and ITaskState,
respectively, and the task switch may perform any needed actions with
them, such as arranging to call back task.step(), or performing
an action such as state.YIELD(value) or state.CALL(task).
|
|