Class: cogen.core.events.TimedOperation
Operations that have a timeout derive from this.
Eg:
yield TimedOperation( timeout=None, weak_timeout=True, prio=priority.DEFAULT )
- timeout - can be a float/int (number of seconds) or a timedelta or a datetime value if it's a datetime the timeout will occur on that moment
- weak_timeout - strong timeouts just happen when specified, weak_timeouts get delayed if some action happens (eg: new but not enough data recieved)
See: Operation. Note: you don't really use this, this is for subclassing for other operations.
Constructor
__init__ (self, timeout=None, weak_timeout=True, **kws)
Methods
cleanup (self, sched, coro)
Clean up after a timeout. Implemented in ops that need cleanup. If return value evaluated to false the sched won't raise the timeout in the coroutine.
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.
process (self, sched, coro)
Attributes
prio
Value of prio
<member 'prio' of 'Operation' objects>
state
Value of state
<member 'state' of 'Operation' objects>
weak_timeout
Value of weak_timeout
<member 'weak_timeout' of 'TimedOperation' objects>