-
Notifications
You must be signed in to change notification settings - Fork 121
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
Subscriptions redesigned #665
Closed
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
be31df8
Redefine subscriptions - breaking changes
mpraglowski 39bc7ad
Refactor subscriptions
mpraglowski 8ff0e36
Subscription storage is optional
mpraglowski 972be0a
All dispatchers & schedulers receive now subscription object instead …
mpraglowski b693e49
Single subscriptions store is enough
mpraglowski 33f34cb
Subscription global or assigned to specific type - it's just an imple…
mpraglowski 2c9e3aa
Minor improvement & fixes
mpraglowski 554cdbe
Docs & lint/specs for subscriptions store
mpraglowski 4f76f27
Docs & specs for Subscription object
mpraglowski e18ceb3
No more local & global subscriptions, there are main subscription sto…
mpraglowski c8dedab
Do not need that anymore
mpraglowski 29e62b4
Simplify subscriptions store API
mpraglowski acc8184
Must be excluded from mutation tests as test where it could be trigge…
mpraglowski 2bd6c6d
Kill mutant
mpraglowski 9aefcdf
Typo fix
mpraglowski 636cafb
It does not make sense to require subscription store to be chainable
mpraglowski ff945e7
Fix subscriptions store lint namespace
mpraglowski cec639c
Add instrumented subscriptions store
mpraglowski b82767b
Use store factory for thread store instead of just a class
mpraglowski 570590f
Again, keep Ruby 2.4 compatibility for now
mpraglowski 7140093
Kill mutations
mpraglowski 25dd989
Add frozen_string_literal: true in all changed files
mpraglowski 4ba25e3
Document subscriptions provider class
mpraglowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
module RubyEventStore | ||
class GlobalSubscription | ||
def initialize(subscriber, store) | ||
def initialize(subscriber, store: nil) | ||
@subscriber = subscriber | ||
@store = store | ||
@store.add(self) | ||
@store.add(self) if @store | ||
end | ||
|
||
def call(event) | ||
(Class === subscriber ? subscriber.new : subscriber).call(event) | ||
end | ||
|
||
def unsubscribe | ||
@store.delete(self) | ||
@store.delete(self) if @store | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with |
||
|
||
def inspect | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't yet see the purpose, checking next commits.