-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
see #264 Add Flux.doOnEach with Signal and individual consumers #288
Conversation
Current coverage is 60.71% (diff: 100%)@@ master #288 diff @@
==========================================
Files 252 252
Lines 23207 24611 +1404
Methods 0 0
Messages 0 0
Branches 4235 4534 +299
==========================================
+ Hits 13986 14942 +956
- Misses 7425 7800 +375
- Partials 1796 1869 +73
|
*/ | ||
public final Flux<T> doOnEach(Consumer<? super T> nextConsumer, | ||
Consumer<? super Throwable> errorConsumer, | ||
Runnable completeRunnable) { |
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.
IMO:
- This isn't 100% required, using consecutive doOnNext() and doOnError() isn't particularly much more verbose.
- If this method does exist i would either, limit it to next/error consumer only, or expand it to include afterTerminate runnable too so it has all signals.
} | ||
|
||
/** | ||
* Triggers side-effects when the {@link Flux} is subscribed, emits an item, fails |
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 really only for the advanced use cases. So if it is exposed, which I don't think is a bad idea, I would explicitly state in Javadoc that it is for advanced used cases and that generally the other more specific doOnXX
should be used instead, else we risk people using this by accident and over-complicating things.
Looks good. |
This is not the original ask from #264 but these
doOnEach
variants have value.