-
Notifications
You must be signed in to change notification settings - Fork 82
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
provides implementation for reconnect mono #229
Conversation
6d93e0c
to
69308dc
Compare
We just discussed with @simonbasle that it makes sense to get rid of Retry at all and let the user configure the retry logic for the upstream. WDYT on that @rstoyanchev? |
It's looking more and more like a candidate for an overloaded |
Closing here and moves back to rsocket again :D |
actual.onNext(this.value); | ||
actual.onComplete(); |
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.
these two lines don't account for the possibility that the actual
Subscriber
hasn't necessarily immediately requested upon onSubscribe
(even though this is usually the case for Mono
s).
this should be toAdd.complete(this.value);
, as you correctly do in the complete()
method.
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.
Right. Missed that
This PR provides derived implementation of Reaconnectable
MonoProcessor
which allows reobtaining the value from upstream + doing reconnection in case of error.Behaviour
APi via given
callMeWhenResetRunnable
runnable.4) Up on reset is called, the first subscription will be delayed depends on the time of the first subscription:
* Subscription happens immeditelly -> delay is defined by the min delay of retry strategy
* Subscription happens after some periode of time -> calculated delay is equal to
subscriptionTime - resetTime
(if negative -> subscribe immediatelly)API
API is derived from
Retry
+ renaming and extra builder methods such asbuild
and
Reconnect<T, C> doOnDispose(Consumer<? super T> onDispose);
which allows disposing value in case ofreconnectableSource
disposure.Why not
Retry
APII tried to use
Retry
interface but then I figured out that the functionality that I need (and this functionality is basicallycalculateBackoff
method is not coupled with Retry itself so I can not be sure that the given interface has a proper method and not just custom implementation. In addition, Reconnect does not require thatFunction<Flux, Flux>
logic so it can be a standalone implementation which is builder only and extends a proper method fromAbstractRetry