Use unit to disambiguate poll timer state
$: config
latest-block=@ud
filter-id=@ud
- poll-timer=@da
+ poll-timer=(unit @da)
snapshot
sap=history
==
::
++ wait-poll
=+ wen=(add now ~m4)
- %- put-move(poll-timer.eye wen)
+ %- put-move(poll-timer.eye `wen)
[%wait name^/poll wen]
::
:: +cancel-wait-poll: remove poll reminder
::
++ cancel-wait-poll
- ?: =(*@da poll-timer.eye) ..cancel-wait-poll
- %- put-move(poll-timer.eye *@da)
- [%rest poll-timer.eye]
+ ?~ poll-timer.eye ..cancel-wait-poll
+ %- put-move(poll-timer.eye ~)
+ [%rest u.poll-timer.eye]
::
:: +| filter-results
::
::
new-filter
:: kick polling timer, only if it hasn't already been.
- =? +> (gth now poll-timer.eye)
+ =? +> |(?=(~ poll-timer.eye) (gth now u.poll-timer.eye))
wait-poll
(take-events rep)
::
