-
Notifications
You must be signed in to change notification settings - Fork 42
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
Proposal: Add ability to specify execution queue in EffectRouter
#155
Conversation
/// Handle an the current `Effect` asynchronously on the provided `DispatchQueue` | ||
/// | ||
/// - Parameter queue: The `DispatchQueue` that the current `Effect` should be handled on. | ||
public func on(_ queue: DispatchQueue) -> Self { |
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.
This is currently returning Self
, which means that .on(..)
can be called multiple times on the same route.
This could be solved by adding another intermediate type. I'm not sure this is worth it.
We could also crash if a queue
has already been set. Again, I think the risk of this is quite low, but we can discuss this further here in the comments.
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 think this is fine
Codecov Report
@@ Coverage Diff @@
## master #155 +/- ##
==========================================
+ Coverage 94.47% 94.50% +0.02%
==========================================
Files 46 46
Lines 1284 1291 +7
==========================================
+ Hits 1213 1220 +7
Misses 71 71
Continue to review full report at Codecov.
|
This adds the ability to specify which queue an effect should be handled on in the
EffectRouter
with the following syntax:Previously, this would have required writing:
This can safely be used in both raw loops and in
MobiusController
loops.@JensAyton @pettermahlen