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

Command dispatch with strong consistency guarantee #83

Merged
merged 5 commits into from Oct 1, 2017

Conversation

slashdotdash
Copy link
Member

Add support for command dispatch that waits for all strongly consistent handlers (event handlers, process managers) to have successfully processed all events created by the command being dispatched.

Implementation

Created a Subscriptions module to track all event store subscriptions. It uses an ETS table to track subscriptions and streams/versions that have been handled per subscription.

Added a consistency option to event handlers, process managers, and command router. It supports either :eventual (default) or :strong consistency.

Consistency is guaranteed by a new command dispatch middleware that blocks after successful dispatch. Once you receive an :ok reply from a command dispatch you are guaranteed that the handlers have completed.

Fixes #82.

Create `Subscriptions` module to track all event store subscriptions. Use ETS table to track subscriptions

Add `consistency` option to event handlers, process managers, and command router.

Create command dispatch middleware to enforce requested consistency guarantee.

Extract aggregate identity from command moved to middleware.
Expire stale entries after one hour. Since the stream ack's are only used during command dispatch, their timeliness is very short lived (seconds - minutes).
@slashdotdash slashdotdash merged commit 436d618 into master Oct 1, 2017
@slashdotdash slashdotdash deleted the feature/dispatch-sync branch October 1, 2017 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant