PurC icon indicating copy to clipboard operation
PurC copied to clipboard

<observe on $TIMERS for 'expired:foobar' >

Open goog opened this issue 3 years ago • 1 comments

i hope the statement is simple like observe 'some event' on timer_id to make the expression more natural

goog avatar Aug 28 '22 13:08 goog

It sounds reasonable, but we use observe not only for the expired event of a timer but also other events from various event source. For example, the event from the renderer indicating the user had closed the window.

Moreover, we can use wildcard in the event name to handle all expired events of multiple times in one time:

    <define as myFooTimerHandler >
        ...
   </define>

    <observe on $TIMERS for 'expired:foo*' with $myFooTimerHandler />

VincentWei avatar Aug 30 '22 07:08 VincentWei