Hi, all. Thanks for your time.
I’m developing a set of TypeScript libraries for Node.js that are heavily inspired by the philosophy and the implementation of Eventuous.
I’d like to support resubscribing to the AllStreamSubscription
as Eventuous does. So, here are my questions for you.
How do I handle subscription drops with the Node.js client? The client doesn’t provide the subscriptionDropped
callback that’s mentioned in the docs.
Maybe, it’s because you thought of a pattern like
const subscription = client.subscribeToAll();
try {
for await (const resolvedEvent of subscription) {
// handle event
}
} catch (error) {
// handle subscription drop
}
If so, how do I get the drop reason? Looking at the CommandError I couldn’t find any mention of drop reasons. Also, there is no explicit mention of a catch-up counterpart of PERSISTENT_SUBSCRIPTION_DROPPED
. Why is that? Does anybody always use persistent subscriptions?
Last question: how do I drop subscriptions on purpose for different reasons?
Thanks again.