NFIBrokerage / spear

A sharp EventStoreDB v20+ client backed by Mint :yum:
https://hex.pm/packages/spear
Apache License 2.0
85 stars 14 forks source link

implement persistent subscriptions to the :all stream #51

Closed the-mikedavis closed 3 years ago

the-mikedavis commented 3 years ago

closes #41 connects #45

Persistent subscriptions to the :all ($all) stream were added in EventStoreDB v21.6.0 with some changes to the protobuf definitions. The value of the :all stream is that you can define server-side filters when creating the persistent subscription instead of the usual route of building a projected stream and subscribing to that. The server-side filter itself is quite transient - it won't leave a big ole' stream on your EventStoreDB like a projected stream will - and it's said to be quite efficient, even less resource intensive than projections (which we've seen to be a bit expensive at times).

This PR adds support for creating, updating, deleting, and connecting to persistent subscriptions to the :all stream, along with a spot of documentation on how this feature is locked behind an EventStoreDB version.