I’m working with the event-store-client package from npm for a Node.js project. I noticed that the API doesn’t seem to include the catch-up subscription facility (i.e. there is no method called subscribeToStreamFrom(…)
Can anyone point me to a demonstration of best practice for implementing the catch up subscription pattern using the limited API offered by the event-store-client package?
I’m thinking of something awkward like readStreamEventsForward from an index that I bookmark in my read model somewhere, but at the same time opening an active subscription so that I don’t miss any new events between the time the forward read ends and the time when the subscription begins. Doing this would mean I’d have to somehow queue the events from the active subscription until I am caught up from the readStreamEventsForward operation. Can someone point me to a best-practice algorithm for handling this cleanly?