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

Subscribe to a stream from a specified start position #17

Closed
slashdotdash opened this issue Oct 4, 2016 · 0 comments
Closed

Subscribe to a stream from a specified start position #17

slashdotdash opened this issue Oct 4, 2016 · 0 comments

Comments

@slashdotdash
Copy link
Member

slashdotdash commented Oct 4, 2016

Allow subscriptions to a single stream, or all streams, to optionally specify a given start position.

  • :origin - subscribe to events from the start of the stream (identical to using 0). This is the current behaviour and will remain the default.
  • :current - subscribe to events from the current version.
  • version - provide an exact stream version to subscribe from.

Subscribe to a single stream

subscribe_to_stream(stream_uuid, subscription_name, subscriber, :origin)  # same as using 0
subscribe_to_stream(stream_uuid, subscription_name, subscriber, :current)

stream_version = 1234
subscribe_to_stream(stream_uuid, subscription_name, subscriber, stream_version)

Subscribe to all streams

subscribe_to_all_streams(subscription_name, subscriber, :origin)  # same as using 0
subscribe_to_all_streams(subscription_name, subscriber, :current)

last_seen_event_id = 1234
subscribe_to_all_streams(subscription_name, subscriber, last_seen_event_id)
@slashdotdash slashdotdash changed the title Subscribe to a stream from a specified position Subscribe to a stream from a specified start position Dec 19, 2016
slashdotdash added a commit that referenced this issue Dec 19, 2016
Fixes #17.

Allow subscriptions to a single stream, or all streams, to optionally
specify a given start position.

- `:origin` - subscribe to events from the start of the stream
(identical to using 0). This is the default behaviour.
- `:current` - subscribe to events from the current version.
- stream version or event id - provide an exact stream version (single
stream), or last seen event id (all stream), to subscribe from.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant