You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RxJava 2's Flowable was designed with Reactive-Streams compliance in mind but didn't follow all rules to the letter. A temporary workaround was the introduction of the strict() operator to enable full compliance. Unfortunately, according to the clarified stance from the specification leads, implementors of Publisher must honor the specification (despite its shortcomings) without excuses or workarounds.
Honoring the specification adds a per-item cost of two atomic increments, manifesting in between the Flowable and an arbitrary Reactive-Streams compliant org.reactivestreams.Subscriber. See Pull 5115 for the benchmark comparison.
Starting from 2.0.7, the Flowable.subscribe(org.reactivestreams.Subscriber) now follows the spec by wrapping via the StrictSubscriber of the strict() operator unless the consuming instance implements a new interface specific to RxJava 2: FlowableSubscriber.
The FlowableSubscriber extends org.reactivestreams.Subscriber but doesn't add any new methods and only overrides four of the textual rules of the specification to enable a relaxed operation within RxJava 2. All internal operators have been converted to use this new interface and thus don't have suffer the per-item overhead required by the specification, including the standard DisposableSubscriber, TestSubscriber and ResourceSubscriber. The lambda-based subscribe() operators were also retrofitted.
If you were implementing a Subscriber (directly or anonymously), you may want to change the interface to FlowableSubscriber. In order to avoid some of the runtime checks when subscribing to Flowable the new subscribe(FlowableSubscriber) has been introduced.
Note that the other reactive base types, Observable, Single, Maybe and Completable are not affected as these were never intended to implement the Reactive-Streams specification (they were only inspired by the spec and are RxJava 2 only to begin with).
Version 2.0.7 - March 7, 2017 (Maven)
Reactive-Streams compliance
Related issue 5110, related pull 5112.
RxJava 2's
Flowable
was designed with Reactive-Streams compliance in mind but didn't follow all rules to the letter. A temporary workaround was the introduction of thestrict()
operator to enable full compliance. Unfortunately, according to the clarified stance from the specification leads, implementors ofPublisher
must honor the specification (despite its shortcomings) without excuses or workarounds.Honoring the specification adds a per-item cost of two atomic increments, manifesting in between the
Flowable
and an arbitraryReactive-Streams
compliantorg.reactivestreams.Subscriber
. See Pull 5115 for the benchmark comparison.Starting from 2.0.7, the
Flowable.subscribe(org.reactivestreams.Subscriber)
now follows the spec by wrapping via theStrictSubscriber
of thestrict()
operator unless the consuming instance implements a new interface specific to RxJava 2:FlowableSubscriber
.The
FlowableSubscriber
extendsorg.reactivestreams.Subscriber
but doesn't add any new methods and only overrides four of the textual rules of the specification to enable a relaxed operation within RxJava 2. All internal operators have been converted to use this new interface and thus don't have suffer the per-item overhead required by the specification, including the standardDisposableSubscriber
,TestSubscriber
andResourceSubscriber
. The lambda-basedsubscribe()
operators were also retrofitted.If you were implementing a
Subscriber
(directly or anonymously), you may want to change the interface toFlowableSubscriber
. In order to avoid some of the runtime checks when subscribing toFlowable
the newsubscribe(FlowableSubscriber)
has been introduced.Note that the other reactive base types,
Observable
,Single
,Maybe
andCompletable
are not affected as these were never intended to implement the Reactive-Streams specification (they were only inspired by the spec and are RxJava 2 only to begin with).API enhancements
ParallelFlowable.sequentialDelayError
.TestSubscriber.withTag
.TestSubscriber.awaitCount
,assertTimeout
&assertNoTimeout
, improve assertion error messageAPI deprecations
Flowable.strict()
deprecated and will be removed in 2.1.0 - the defaultFlowable
behavior is now strict.Bugfixes
Maybe.concat()
subscribe-after-cancel, verify others.doOnSubscribe
signallingUndeliverableException
instead ofonError
.window(time, size)
not completing windows on timeout.Observable.combineLatest
to dispose eagerly.Observable.zip
to dispose eagerly.flatMap
not cancelling the upstream eagerly.repeatWhen
andretryWhen
signatures.Other
@NonNull
attribute toFunction7
.Flowable
as aPublisher
to be fully RS compliant.flatMap()
overloads.@NonNull
to the methods ofEmitter
The text was updated successfully, but these errors were encountered: