RUMM-2331: Simple message bus for cross-feature communication#1087
Merged
0xnm merged 1 commit intoOct 17, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/sdkv2 #1087 +/- ##
=================================================
+ Coverage 82.53% 82.54% +0.01%
=================================================
Files 347 347
Lines 11183 11196 +13
Branches 1834 1838 +4
=================================================
+ Hits 9229 9241 +12
- Misses 1391 1392 +1
Partials 563 563
|
xgouchet
approved these changes
Oct 17, 2022
mariusc83
approved these changes
Oct 17, 2022
0xnm
force-pushed
the
nogorodnikov/rumm-2331/message-bus-for-cross-feature-communication
branch
from
October 17, 2022 12:09
72fe800 to
c3b4712
Compare
0xnm
deleted the
nogorodnikov/rumm-2331/message-bus-for-cross-feature-communication
branch
October 17, 2022 12:41
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
This change introduces the way to send messages to the particular feature which is useful in case if this feature is an optional dependency.
This is achieved by using
FeatureScope#sendEventmethod which just dispatches the event to the registered receiver for the given feature.I didn't find the need for the broadcast message and also since events are always targeting the particular feature the host of the
sendEventmethod is notSdkCore, butFeatureScope. This removes the need for thetargetargument of thesendEventmethod, because we always target the feature by doingSdkCore#getFeaturewhich returnsFeatureScope.Message bus in the current implementation doesn't add any thread model: event will be received on the same thread as it was sent.
Review checklist (to be filled by reviewers)