-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow to specify default dispatcher for formula. #348
Merged
Merged
Conversation
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
JaCoCo Code Coverage 80.55% ✅
Generated by 🚫 Danger |
Laimiux
force-pushed
the
laimonas/explore-default-dispatcher
branch
from
March 4, 2024 22:02
2769c43
to
ae59bbf
Compare
Laimiux
commented
Mar 4, 2024
@@ -31,10 +31,10 @@ object FormulaPlugins { | |||
} | |||
|
|||
fun mainThreadDispatcher(): Dispatcher { | |||
return plugin?.mainThreadDispatcher() ?: Dispatcher.NoOp | |||
return plugin?.mainThreadDispatcher() ?: Dispatcher.None |
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.
Renamed from NoOp
to None
Laimiux
force-pushed
the
laimonas/explore-default-dispatcher
branch
from
March 4, 2024 22:05
ae59bbf
to
8dee4fb
Compare
jasonostrander
approved these changes
Mar 4, 2024
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.
LGTM
Laimiux
force-pushed
the
laimonas/explore-default-dispatcher
branch
from
March 5, 2024 19:45
8dee4fb
to
990134b
Compare
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
By default, we process formula updates on a thread that emits the event. This pull request adds functionality to specify a default dispatcher which enables us to globally move all processing to a background thread.
You can specify a default dispatcher at the plugin level which will be applied to all formulas:
Alternatively, you can specify default dispatcher for a single formula via
toObservable
ortoFlow
:Not part of this pull request
In a follow-up pull request, we will add ability to control dispatcher for individual transitions.
Within an individual formula, a developer can specify
Transition.ExecutionType
such asTransition.Immediate
to override the default behavior.Alternatively, it can also specify
Transition.Background
execution type for certain events