EngineTimer

class ClusterShell.Engine.Engine.EngineTimer(fire_delay, interval, autoclose, handler)

Concrete class EngineTimer

An EngineTimer object represents a timer bound to an engine that fires at a preset time in the future. Timers can fire either only once or repeatedly at fixed time intervals. Repeating timers can also have their next firing time manually adjusted.

A timer is not a real-time mechanism; it fires when the task's underlying engine to which the timer has been added is running and able to check if the timer's firing time has passed.

__delattr__

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__

Return self==value.

__format__()

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__()

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__(fire_delay, interval, autoclose, handler)

Create a base timer.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

Helper for pickle.

__reduce_ex__()

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

invalidate()

Invalidates a timer object, stopping it from ever firing again.

is_valid()

Returns a boolean value that indicates whether an EngineTimer object is valid and able to fire.

set_nextfire(fire_delay, interval=-1)

Set the next firing delay in seconds for an EngineTimer object.

The optional parameter interval sets the firing interval of the timer. If not specified, the timer fires once and then is automatically invalidated.

Time values are expressed in second using floating point values. Precision is implementation (and system) dependent.

It is safe to call this method from the task owning this timer object, in any event handlers, anywhere.

However, resetting a timer's next firing time may be a relatively expensive operation. It is more efficient to let timers autorepeat or to use this method from the timer's own event handler callback (ie. from its ev_timer).