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

Defer event handler and process router init until after subscribed #138

Merged
merged 2 commits into from
Feb 6, 2018

Conversation

slashdotdash
Copy link
Member

@slashdotdash slashdotdash commented Feb 6, 2018

Expect event store adapters to send a {subscribed, subscription} message once successfully subscribed.

This is used to defer initialisation for event handlers, such as calling the init/0 callback, and process routers. One benefit of deferring init/0 is that it will only run once, irrespective of how many nodes are running your app and the event handler.

@slashdotdash slashdotdash force-pushed the feature/subscribed-init branch 4 times, most recently from 015d574 to da5b150 Compare February 6, 2018 12:24
Event store adapter sends a `{:subscribed, subscription}` message once the subscription has successfully subscribed.

This can be used to defer initialisation for event handlers, such as the `init/0` callback, and process routers.
@slashdotdash slashdotdash merged commit d8f1bbc into master Feb 6, 2018
@slashdotdash slashdotdash deleted the feature/subscribed-init branch February 6, 2018 12:26
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