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

next EventStoreDB release will introduce a breaking behavior change for reads #54

Closed the-mikedavis closed 3 years ago

the-mikedavis commented 3 years ago

This commit will introduce some new behavior: reading a stream (Spear.stream!/3 or Spear.subscribe/4) will emit a new ReadResp content-type when finished reading the chunk (in a normal read) and when at the end of the stream

{"event_store.client.streams.ReadResp": {:stream_position,
   {:"event_store.client.streams.ReadResp.StreamPosition", 5, 5}}}

While the change to the protobuf definition is not itself a breaking change because of the way protobuf encoding works, clients using that new EventStoreDB version will be unable to use any existing release of spear as that message will fail to decode with a FunctionClauseError.

NFIBrokerage/event_store_db_gpb_protobufs will need an update as usual and the next release of spear will need to require the new version.

The following will need to be refactored:

As well as the creation of at least one new data structure for these stream position packets.