Package circuits :: Module timers :: Class Timer

Class Timer

    object --+            
             |            
  core.Manager --+        
                 |        
core.BaseComponent --+    
                     |    
        core.Component --+
                         |
                        Timer

Timer(s, e, c, t, persist) -> new timer component

Creates a new timer object which when triggered will push the given event onto the event queue.

s := no. of seconds to delay e := event to be fired c := channel to fire event to t := target to fire event to

persist := Sets this timer as persistent if True.

Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
new timer component
__init__(s, e, c, t='timer', persist=None)
initializes x; see x.__class__.__doc__ for signature
 
__tick__(self)
None
reset(T)
Reset the timer.
state
poll(T)
Check if this timer is ready to be triggered.

Inherited from core.BaseComponent: __call__, __repr__, register, unregister

Inherited from core.Manager: __add__, __iadd__, __isub__, __len__, __sub__, flush, push, run, send, start, stop

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods

Inherited from core.Component: __new__

Instance Variables

Inherited from core.BaseComponent: channel

Inherited from core.Manager: manager

Properties

Inherited from core.Manager: channels, components, running, state, ticks

Inherited from object: __class__

Method Details

__init__(s, e, c, t='timer', persist=None)
(Constructor)

 

initializes x; see x.__class__.__doc__ for signature

Returns: new timer component
Overrides: object.__init__

poll(T)

 

Check if this timer is ready to be triggered. If so, push the event onto the event queue.

If timer is persistent, reset it after triggering.

Returns: state