Table Of Contents

Previous topic

ginsfsm.gconfig

Next topic

ginsfsm.router

ginsfsm.c_timer

GObj GTimer

GObj for generate timeout events.

class ginsfsm.c_timer.GTimer[source]

Supply timer events.

Broadcast the timeout_event_name event when the seconds time has elapsed.

If autostart is True, the timer is cyclic.

Configurable Parameters:
Name Type Default value Description
subscriber None None subcriber of all output-events. Default is None, i.e., the parent
seconds int -1 timeout in seconds. With seconds=-1 the current timer is cancelled
timeout_event_name str EV_TIMEOUT Timeout event name
autostart bool False If True then timeout event is repeated every seconds
Diagram:

Input-Events:

  • 'EV_SET_TIMER': Set the timer.

    Broadcast the 'EV_TIMEOUT' or timeout_event_name event when the seconds time has elapsed.

    If autostart is true, the timer is cyclic.

    Associated data to event:

    • seconds: seconds of timer.
    • autostart: cyclic timer.

    With seconds=-1 the current timer is cancelled.

Output-Events:

  • 'EV_TIMEOUT': Timer over.

    Send the 'EV_TIMEOUT' or timeout_event_name event to subscribers.

start_up()[source]

Subcribe the output-events to subscriber.

The output-events are broadcasting using post_event(), forcing to get timeout events by queue, not directly.