Reactive Streams rule 2.3 mandates, that Subscriber.onComplete() and Subscriber.onError(Throwable t) MUST NOT call any methods on the Subscription or the Publisher.
Our current amb operator implementation also performs a cancellation on the Single that just completed, which violates the rule.
Modifications
This changeset modifies the amb operator in a way that all but the one Single which got a termination signal (through onNext or onError) will get the cancellation propagated.
The test suite is enhanced to cover this scenario, both for ambWith as well as the static amb factory methods. Since the Completable also converts to Single underneath, the functionality is transitively available as well.
Result
The amb* operator variants adhere to reactive streams 2.3 rule.
Motivation
Reactive Streams rule 2.3 mandates, that
Subscriber.onComplete() and Subscriber.onError(Throwable t) MUST NOT call any methods on the Subscription or the Publisher
.Our current amb operator implementation also performs a cancellation on the Single that just completed, which violates the rule.
Modifications
This changeset modifies the amb operator in a way that all but the one Single which got a termination signal (through
onNext
oronError
) will get the cancellation propagated.The test suite is enhanced to cover this scenario, both for
ambWith
as well as the staticamb
factory methods. Since theCompletable
also converts toSingle
underneath, the functionality is transitively available as well.Result
The
amb*
operator variants adhere to reactive streams 2.3 rule.