HVML / PurC

The prime HVML interpreter for C Language.
GNU Lesser General Public License v3.0
1.06k stars 54 forks source link

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

Closed goog closed 1 year ago

goog commented 2 years ago

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

VincentWei commented 2 years ago

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 />