I’m building a C# client using the TCP interface that will efficiently store a projection in a view model database (eg document or graph db). I can easily batch the events before the subscription catches up by flushing using the liveProcessingStarted delegate.
However, there is no way I can see to easily batch events when in “live processing” mode. The scenario I am envisaging is that lots of events have been generated quicker than they can normally be processed, and we now want the client to batch.
To facilitate this, would it be possible to add the position in the stream, plus the last known number at the point the event is sent? This way we could make an intelligent decision on whether to batch or not. Alternatively it could be a flag like EventSlice.IsEndOfStream, or even just sending all the events in a pre-configured batch size.
The only way I can see to do this at the moment would be to wait some period of time to see if another event comes in, before processing.