Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Timer Events

Use EventTicker for a steady beat (blink, poll, heartbeat). Use EventTimer for a one-shot delay or deadline. Details and a desktop demo: Events and examples/events/ticker-timer-demo.fnl.

Create with handler + index, then arm:

  o:.handleTicker~ 0 EventTicker.new^ o:.ticker!
  500 Interval.millisecond dt::* o:.ticker.eventEvery^

  o:.handleTimeout~ 0 EventTimer.new^ o:.timer!
  60 Interval.second dt::* o:.timer.eventAfter^
TypeArmPauseDone
EventTicker.eventEvery ( Interval -- ).stop.close
EventTimer.eventAfter or .eventAt.stop.close

Handler sketch:

: LedBtnCtrl#handleTicker
  drop
  o:.blink if
    o:.led.value not o:.led.value!
  then
;

Always .close^ in your stop path so events do not keep firing after teardown.