-
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
Polish Signal based operators #779
Conversation
smaldini
commented
Aug 3, 2017
- Turn Signal into interface
- Remove MutableNextSignal
- Precise FluxPeekStateful to FluxDoOnEach
- Turn Signal into interface - Remove MutableNextSignal - Precise FluxPeekStateful to FluxDoOnEach
3e614f9
to
59de1d3
Compare
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.
can you explain the rationale for this PR? seems like mutable signal and more generic FluxPeekStateful
could be useful in avoiding creating too much garbage (wrapping every element in a new Signal)
@@ -69,4 +70,72 @@ public SignalType getType() { | |||
return type; | |||
} | |||
|
|||
//the base class defines equals and hashcode as final in order to allow | |||
|
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.
equals is not final and this is not a base class anymore, so remove broken comment ;)
} | ||
return false; | ||
} | ||
//to implement additional state. |
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.
that was part of the comment of equals, remove it too
The rationale is simply shrinking surface API when possible due to its specificity and simplicity to reproduce. Also the operator was only used by doOnEach and if we happen to implement a doOnNext with state we'll revisit. In fact this operator should also be used by ParallelFlux too and eventually be fuseable. |
Also DoOnEachSubscriber implement Signal directly to avoid allocations. |