Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent subscriptions to $all #108

Merged
merged 1 commit into from
May 6, 2021
Merged

Persistent subscriptions to $all #108

merged 1 commit into from
May 6, 2021

Conversation

shaan1337
Copy link
Member

@shaan1337 shaan1337 commented Apr 5, 2021

Fixes: https://github.com/EventStore/home/issues/434
Fixes: https://github.com/EventStore/home/issues/435

Client-side PR for : EventStore/EventStore#2869

From the user-perspective, this PR changes the API as follows:

  • In CreateAsync(), UpdateAsync(), DeleteAsync() and SubscribeAsync(), $all can now be passed as stream name (also defined by constant: SystemStreams.AllStream)
  • Also added wrappers: CreateToAllAsync(), UpdateToAllAsync(), DeleteToAllAsync() and SubscribeToAllAsync() to make the feature more easily discoverable in the API
  • startFrom in PersistentSubscriptionSettings is now an IPosition? (new interface) instead of a StreamPosition? (not a breaking change since StreamPosition now implements IPosition)

Important changes:

  • SystemStreams class has been moved from src/EventStore.Client.Streams to src/EventStore.Client and $all has been added to it

hayley-jean
hayley-jean previously approved these changes Apr 29, 2021
hayley-jean
hayley-jean previously approved these changes May 3, 2021
YoEight
YoEight previously approved these changes May 5, 2021
@shaan1337 shaan1337 dismissed stale reviews from YoEight and hayley-jean via a455a29 May 5, 2021 11:03
@shaan1337 shaan1337 force-pushed the psub-to-all branch 2 times, most recently from a455a29 to 35049d7 Compare May 5, 2021 11:04
Update persistent subscriptions proto file

Make StreamPosition and Position implement new interface: IPosition
Convert `StreamPosition StartFrom` to `IPosition? StartFrom` in PersistentSubscriptionSettings

Move SystemStreams.cs from src/EventStore.Client.Streams to src/EventStore.Client and add the $all stream
Move SystemMetadata class to a separate file in the EventStore.Client.Streams project

Added: Create persistent subscriptions to $all

Added: Update persistent subscriptions to $all

Added: Delete persistent subscriptions to $all

Added: Read from persistent subscriptions to $all

Delete no longer valid test: create_on_all_stream.the_completion_fails_with_invalid_stream

Update existing tests to use SystemStreams.AllStream/SystemRoles.All instead of "$all"

Move all persistent subscription to stream tests to SubscriptionToStream directory

Move stream persistent subscription tests to EventStore.Client.SubscriptionToStream namespace

Added tests: create persistent subscriptions to $all

Added tests: update persistent subscriptions to $all

Added tests: delete persistent subscriptions to $all

Added tests: connect to persistent subscriptions to $all

Added tests: ACK/NAK for persistent subscriptions to $all

Add the following wrappers to the persistent subscription client: CreateToAllAsync, DeleteToAllAsync, UpdateToAllAsync, SubscribeToAllAsync

Update tests to use wrappers: CreateToAllAsync, DeleteToAllAsync, UpdateToAllAsync, SubscribeToAllAsync
@shaan1337
Copy link
Member Author

shaan1337 commented May 5, 2021

  • Commits squashed
  • Breaking change fix reverted (since the breaking change is now in master)
  • Rebased to master, fixing conflict in StreamPosition.cs due to the recent IComparable addition

Note: Regression tests on this PR should fail until #115 has been merged.

@shaan1337 shaan1337 requested review from YoEight and hayley-jean May 5, 2021 11:18
@hayley-jean hayley-jean merged commit 28742a0 into master May 6, 2021
@hayley-jean hayley-jean deleted the psub-to-all branch May 6, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants