I’m trying to figure out how to create a Reactive subscription for an event not followed by a different event within a specific time window.
To illustrate, here’s a use case:
A busy indicator triggered by two events. Busy and NotBusy. They may fire close together but the indicator should not flash on/off too often.
When NotBusy fires, there should be no indicator. When Busy fires and NotBusy hasn’t fired within 5 seconds then it should display.
Is there a way to do this entirely within Reactive without adding external state?
Ah, I can’t resist – how often do you get to counter-answer the author of the source material? (see Benjol’s comment on question) 🙂
Here’s my stab at it (LINQPad-ready):
Output looks like this:
Here a basic definition of our events:
And here’s the query + test code: