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

Transient subscriptions #215

Merged

Conversation

tcoopman
Copy link
Contributor

@tcoopman tcoopman commented Aug 19, 2020

This feature is needed to fix: commanded/commanded#401

TODO

  • check what needs to happen for to subscribe from a disconnected state
  • checkpoint_last_seen or notify_subscribers probably needs to be changed as well
  • add more tests
  • add to documentation

I guess a transient subscription can never get in a disconnected state, because the AdvisoryLocks are only used for saved subscriptions.

In theory checkpoint_last_seen doesn't need to be changed, because the update statement will not fail, but changed it as well so we don't even try to update.

To discuss

Because we don't store anything, it's possible to:

  1. start a persistent subscription with name "foo"
  2. have it killed and later start a transient subscription with name "foo" that receives all events again
  3. later kill that transient subscription and start the persistent subscription "foo" again, this will now just resume after the lasted acked events that the persistent subscription "foo" saw.

I think this is logical, but it might surprise some users, so I'll add it to the documentation.

@tcoopman
Copy link
Contributor Author

I'm not sure why this PR also includes e9e9492. I thought I started from master correctly.

@slashdotdash
Copy link
Member

Yes, it looks like you are on the right track.

@tcoopman tcoopman changed the title WIP - Feature: transient subscriptions Feature: transient subscriptions Aug 20, 2020
@tcoopman
Copy link
Contributor Author

@slashdotdash I think the functionality is complete, so ready for review.

@slashdotdash slashdotdash changed the base branch from develop to master October 30, 2020 15:50
@slashdotdash slashdotdash changed the title Feature: transient subscriptions Transient subscriptions Oct 30, 2020
@slashdotdash slashdotdash merged commit e4b56e2 into commanded:master Oct 30, 2020
@slashdotdash
Copy link
Member

Thanks @tcoopman, sorry for the delay in merging your PR.

slashdotdash added a commit that referenced this pull request Oct 30, 2020
Add @tcoopman to contributors in README.
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.

Transient Event Handlers
2 participants