When processing events in real time, without a doubt I'd say that the right approach is to use Rx
and IObservable
.
But what if you had to re-process those same events after they've been captured and persisted?
Now they have an additional timestamp field and you can "replay" them by converting an IEnumerable< TEvent >
into an IObservable< TEvent >
. You have queries to run that rely on configuring windows and buffers and this works easily in realtime using TimeSpan.FromSeconds()
but becomes kind of clunky with IObservable
when the events have Timestamps (see this very related question: How to window/buffer IObservable<T> into chunks based on a Func<T> ) Do you abandon IObservable and use IEnumerable?
Finally, how does one approach the challenge of an event stream that starts in the past and is replayed up to the present with Timestamps and continues into the future?