Class: cogen.core.events.Operation
All operations derive from this. This base class handles the priority flag.
Eg:
yield Operation(prio=priority.DEFAULT)
- prio - a priority constant, where the coro is appended on the active coroutine queue and how the coroutine is runned depend on this.
If you need something that can't be done in a coroutine fashion you probabily need to subclass this and make a custom operation for your issue.
Note: you don't really use this, this is for subclassing for other operations.
Constructor
__init__ (self, prio=-1)
Methods
finalize (self)
Called just before the Coroutine wrapper passes the operation back in the generator. Return value is the value actualy sent in the generator. Subclasses might overwrite this method and call it from the superclass.
process (self, sched, coro)
This is called when the operation is to be processed by the scheduler. Code here works modifies the scheduler and it's usualy very crafty. Subclasses usualy overwrite this method and call it from the superclass.
Attributes
prio
Value of prio
<member 'prio' of 'Operation' objects>
state
Value of state
<member 'state' of 'Operation' objects>