Skip to content

Instantly share code, notes, and snippets.

View eersnington's full-sized avatar

Sree Narayanan eersnington

View GitHub Profile
@eersnington
eersnington / poll-until-rfc.md
Created November 7, 2025 00:42
RFC: Deterministic pollUntil()

RFC For Deterministic pollUntil() function

Allow me a moment for my pessimistic side to take control of this gist to say that this RFC might be more of a Reasonably Futile Concept rather than being a Request For Comments. But I've been looking into the what, hows, and whys of this amalgamation of thinking tokens for quite a while with the current mental model of WDK, and maybe what can be done about it.

Ground Zero

Polling isn't ideal (side-note: I think WDK has the potential to cheat it), but I keep seeing this pattern of WDK code (and even my best friend when I showed WDK primitives) which made me go down this rabbit hole. I wrote this gist to spell out why is "call status -> sleep -> repeat" loop feels natural, how it actually plays with determinism, and what a first-class helper could do to make it easier for everyone.

1. The useReflex: I'll just loop and slap in an await sleep("15s")