Suppose I have an interval event with a known end time, is there a way to fire off another event, before the said interval event expires. The purpose of this is that at that point I need to do an aggregate.
Alternatively is there a way to do a query (this is not as desired but I might have to resort to it)
(from input in inputStream
select input).AddDelay(input.EndTime - DateTime.UtcNow)
In case my understanding is completely off, please suggest a better approach.
First, we need to filter your source stream to get a stream of x1 events.
Next, we need to filter your source stream to get a stream of non-x1 events.
Now we'll join the x1 event stream with the non-x1 event stream to get a list of all the non-x1 events that occur during an x1 event.
Getting a count of the non-x1 events that occur during an x1 event will require some kind of HoppingWindow to be able to actually count the events in the stream over a fixed period of time. You can also call ToEnumerable() to be able to do the grouping without a window.