Releases: ReactiveX/RxJava
2.0.0-RC3
This Release Candidate features mostly internal cleanups of code and Javadoc, Reactive-Streams Test Compatibility Kit implementations (and thus verification) of our Flowable
implementation and additional unit-test coverage. Big thanks to @vanniktech for the many contributions and @JakeWharton for the continued reviews.
Other notable changes:
- The new
Maybe
type of RC2 now features all relevant operators. - Many
Observable
andFlowable
operators now returnSingle
orMaybe
. - Pull 4525 : Fixed generics of
combineLatest
andzip
becauseFunction<? super T[], R>
doesn't work. - Pull 4522 : Fixed
delay
operator to callonError
on the provided scheduler - Pull 4490 : rename
isCancelled
toisDisposed
inside the varios emitters ofcreate()
- Pull 4504 : add default
XObserver
implementation toSingle
,Maybe
andCompletable
- Pull 4518 : add
ResourceXObserver
implementation toSingle
,Maybe
andCompletable
- Pull 4536 : fix
timeout
operators not properly cancelling/disposing the upstream. - Pull 4583 :
Flowable.create()
'sFlowableEmitter
didn't handlenull
s properly. - Pull 4586 : Add error assertion with predicate to
TestSubscriber
andTestObserver
.
In addition, the wiki page What's different in 2.0 has been extended with more information.
1.2.0
This is a minor release that is functionally equivalent to 1.1.10 minus the removal of some deprecated experimental APIs.
Promote @Beta
to standard (@since 1.2
)
- in
rx.Observable
create(SyncOnSubscribe<S, T>)
doOnRequest(Action1<Long>)
flatMap(Func1<? super T, ? extends Observable<? extends R>>, Func1<? super Throwable, ? extends Observable<? extends R>>, Func0<? extends Observable<? extends R>>, int)
flatMap(Func1<? super T, ? extends Observable<? extends R>>, int)
flatMap(Func1<? super T, ? extends Observable<? extends U>>, Func2<? super T, ? super U, ? extends R>, int)
flatMapIterable(Func1<? super T, ? extends Iterable<? extends R>>, int) rx.Observable.flatMapIterable(Func1<? super T, ? extends Iterable<? extends U>>, Func2<? super T, ? super U, ? extends R>, int)
fromCallable(Callable<? extends T>)
toSingle()
rx.Single
(the class itself)fromCallable(Callable<? extends T>)
rx.SingleSubscriber<T>
- in
rx.observables.ConnectableObservable
autoConnect()
autoConnect(int, Action1<? super Subscription>)
autoConnect(int)
rx.observables.SyncOnSubscribe<S, T>
- in
rx.subjects.AsyncSubject
getThrowable()
getValue()
hasCompleted()
hasThrowable()
hasValue()
- in
rx.subjects.BehaviorSubject
getThrowable()
getValue()
getValues()
getValues(T[])
hasCompleted()
hasThrowable()
hasValue()
- in
rx.subjects.PublishSubject
getThrowable()
hasCompleted()
hasThrowable()
- in
rx.subjects.ReplaySubject
getThrowable()
getValue()
getValues()
getValues(T[])
hasAnyValue()
hasCompleted()
hasThrowable()
hasValue()
size()
Promote @Experimental
to @Beta
rx.BackpressureOverflow
- in
rx.Observable
concatDelayError(Iterable<? extends Observable<? extends T>>)
concatDelayError(Observable<? extends Observable<? extends T>>)
concatEager(Iterable<? extends Observable<? extends T>>, int)
concatEager(Iterable<? extends Observable<? extends T>>)
concatEager(Observable<? extends Observable<? extends T>>, int)
concatEager(Observable<? extends Observable<? extends T>>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)
concatEager(Observable<? extends T>, Observable<? extends T>)
concatMapDelayError(Func1<? super T, ? extends Observable<? extends R>>)
concatMapEager(Func1<? super T, ? extends Observable<? extends R>>, int, int)
concatMapEager(Func1<? super T, ? extends Observable<? extends R>>, int)
concatMapEager(Func1<? super T, ? extends Observable<? extends R>>)
delaySubscription(Observable<U>)
distinctUntilChanged(Func2<? super T, ? super T, Boolean>)
mergeDelayError(Observable<? extends Observable<? extends T>>, int)
onBackpressureBuffer(long, Action0, Strategy)
switchMapDelayError(Func1<? super T, ? extends Observable<? extends R>>)
switchOnNextDelayError(Observable<? extends Observable<? extends T>>)
toCompletable()
toSortedList(Func2<? super T, ? super T, Integer>, int)
toSortedList(int)
using(Func0<Resource>, Func1<? super Resource, ? extends Observable<? extends T>>, Action1<? super Resource>, boolean)
- in
rx.observables.BlockingObservable
subscribe()
subscribe(Action1<? super T>, Action1<? super Throwable>, Action0)
subscribe(Action1<? super T>, Action1<? super Throwable>)
subscribe(Action1<? super T>)
subscribe(Observer<? super T>)
subscribe(Subscriber<? super T>)
rx.Completable
- in
rx.Single
defer(Callable<Single<T>>)
delay(long, TimeUnit, Scheduler)
delay(long, TimeUnit)
delaySubscription(Observable<?>)
doAfterTerminate(Action0)
doOnError(Action1<Throwable>)
doOnSubscribe(Action0)
doOnSuccess(Action1<? super T>)
doOnUnsubscribe(Action0)
lift(Operator<? extends R, ? super T>)
onErrorResumeNext(Func1<Throwable, ? extends Single<? extends T>>)
onErrorResumeNext(Single<? extends T>)
toBlocking()
toCompletable()
using(Func0<Resource>, Func1<? super Resource, ? extends Single<? extends T>>, Action1<? super Resource>, boolean)
using(Func0<Resource>, Func1<? super Resource, ? extends Single<? extends T>>, Action1<? super Resource>)
rx.exceptions.CompositeException.CompositeException(Throwable...)
- in
rx.exceptions.Exceptions
throwOrReport(Throwable, Observer<?>, Object)
throwOrReport(Throwable, Observer<?>)
throwOrReport(Throwable, SingleSubscriber<?>)
rx.singles.BlockingSingle<T>
Removed
- in
rx.Observable
extend(Func1<OnSubscribe<T>, R>)
: useto(Func1)
insteadfromAsync()
: renamed tofromEmitter()
- in
rx.Completable
CompletableSubscriber
: nowrx.CompletableSubscriber
CompletableOnSubscribe
: renamed toCompletable.OnSubscribe
CompletableOperator
: renamed toCompletable.Operator
CompletableTransformer
: renamed toCompletable.Transformer
2.0.0-RC2
This Release Candidate features a large amount of internal fixes, cleanups and enhancements. Please refer to the closed PRs for its milestone. This includes the bugfix for the Single.subscribeOn
failing with Disposable already set!
error printed to the console (Issue 4448, Pull 4450).
The library now has a new base reactive type: Maybe
which is essentially a Single
and Completable
combined. You can have exactly 1 onSuccess, 1 onError or 1 onComplete signals with it. Note however that it doesn't have all the operators possible for this type of source but you can convert it back and forth to the other base reactive types (i.e., Flowable
, Single
, Completable
and Observable
). Unlike Project Reactor's Mono
type, this doesn't implement the Reactive-Streams Publisher
(but is designed along the idea) and doesn't have backpressure (as there is no chance of buffer-bloat like with unknown length Flowable
s and Observable
s).
1.1.10
The release contains a few javadoc and internal cleanups, some enhancements and some deprecations.
Notable renames:
fromAsync
is nowfromEmitter
rx.Completable.CompletableSubscriber
is nowrx.CompletableSubscriber
API enhancements
- Pull 4423: add free-form conversion operator
to(Func1)
toObservable
,Single
andCompletable
. - Pull 4425: Rename
Completable
helper interfaces by dropping theCompletable
prefix, moverx.Completable.CompletableSubscriber
torx.CompletableSubscriber
. - Pull 4442: Rename
fromAsync
tofromEmitter
. - Pull 4452: Enhance generics on Observable.onErrorResumeNext and onErrorReturn
- Pull 4442: Add
Completable.fromEmitter
- Pull 4453: Remove
throws InterruptedException
fromTestSubscriber.awaitValueCount()
- Pull 4460: Add
Completable.doOnEach(Action1)
- Pull 4461: Add
Single.doOnEach
Deprecations
- Pull 4425: Deprecate
CompletableOnSubscribe
,CompletableOperator
andCompletableTransformer
and rename them by dropping theCompletable
prefix - Pull 4442: Deprecate
Observable.fromAsync
by renaming it toObservable.fromEmitter
. - Pull 4466: Deprecate
Notification.createOnCompleted(Class)
Bugfixes
2.0.0-RC1
RxJava 2.0 has been rewritten from scratch to be more performant, lower overhead (memory and cpu) and to natively implement the Reactive-Streams specification in its new Flowable
type. The library still supports Java 6+ and is considered a 4th generation reactive library.
There have been hundreds of PRs and large amounts of changes compared to the 1.x version. The two are binary-incompatible but their distinct maven coordinates (io.reactivex.rxjava2:rxjava:2.0.0-RC1
) allow them to co-exist. You can use the rxjava2-interop library to convert between 1.x and 2.x types.
Please refer to the wiki page about the differences between the two major versions.
Converting the companion libraries is an ongoing effort. For now, see the rxjava2-extensions project that contains the port of the RxJavaMath features. Note that most companion libraries of RxJava are currently not set up properly for release (the signing keys are missing from the CI release process) and is unknown if and when they will have their own 2.x release branch.
I'd like to thank for the contributions of the following community members (in LIFO commit-merge order):
@davidmoten, @JakeWharton, @vanniktech, @dimitar-asenov, @artem-zinnatullin, @bobvanderlinden, @DmitriyZaitsev, @zsxwing, @bcorne, @stevegury, @benjchristensen, @stealthcode, @adam-arold and @abersnaze.
A special thanks goes out to @smaldini, Project-Reactor lead at Pivotal. Our ongoing cooperation lead to the massive improvement of the RxJava 2.x architecture (originally designed in August 2015) by learning from and building upon the results of the Reactive-Streams-Commons research project.
1.1.9
(Maven)
This release contains mostly internal cleanups, reinforced Observable-protocol adherence and minor javadoc fixes.
Warning: the backpressure-behavior of PublishSubject
has been changed. In earlier versions, when you called PublishSubject.onNext
too frequently, that usually triggered a MissingBackpressureException
in some downstream operator (observeOn
, zip
, etc.) and often it was not obvious who to blame for it. With 1.1.9, PublishSubject
now tracks the request amounts of each of its children and refuses to overflow them, signalling a MissingBackpressureException
to them instead which now points to the right operator.
API enhancements
- Pull 4226: Add
Single.flatMapCompletable
. - Pull 4225:
PublishSubject
now signalsMissingBackpressureException
when backpressured. - Pull 4264: Add
Observable.sorted()
+ overloads: sorts and re-emits each element of a finite sequence. - Pull 4261: Add
concatDelayError
multiple arguments. - Pull 4330: Add
Observable.concat(Iterable)
overload. - Pull 4322: Add
TestSubscriber.assertValuesAndClear
Performance enhancements
- Pull 4232: Less allocation in operator
amb
. - Pull 4233: Less allocation in
autoConnect
. - Pull 4236: Less allocation in
join
. - Pull 4237: Less allocation in
groupJoin
. - Pull 4239: Less allocation in
skip
with time. - Pull 4262: Less allocation in
doOnEach
. - Pull 4328: Compact
MultipleAssignmentSubscription
andSerialSubscription
Bugfixes
- Pull 4231:
Schedulers.io()
workers now wait until a blocking task finishes before becoming available again. - Pull 4244: Fix
all
multiple terminal events. - Pull 4241: Fix reentrancy bug in
repeatWhen
andretryWhen
when the resubscription happens. - Pull 4225:
PublishSubject
now checks for unsubscribed child while dispatching events. - Pull 4245: Fix
any
multiple terminal events. - Pull 4246: Fix
reduce
multiple terminal events. - Pull 4250: Fix
onBackpressureDrop
multiple terminal events. - Pull 4252: Fix
collect
multiple terminal events. - Pull 4251: Fix
toMap
multiple terminal events and backpressure behavior. - Pull 4270: Fix
toMultimap
multiple terminal events . - Pull 4311: Fix
Schedulers.from()
to callRxJavaHooks.onScheduleAction
.
1.1.8
1.1.7
Version 1.1.7 - July 10, 2016 (Maven)
This release has several documentation fixes (AsyncSubject
, doOnEach
, cache
, scan
, reduce
, backpressure descriptions) and internal cleanups based on tool feedback (code-coverage and PMD).
Warning: behavior change in the time-bound replay()
operator: the aging of the values continues after the termination of the source and thus late subscribers no longer get old data. For example, a given just(1).replay(1, TimeUnit.MINUTE)
a subscriber subscribing after 2 minutes won't get 1
but only onCompleted
.
Warning: behavior change in timestamp()
and timeInterval()
(no arguments) operators: they now take timing information from the computation
scheduler instead of the immediate
scheduler. This change now allows hooking these operators' time source.
Warning: the parameter order of Completable.subscribe(onError, onComplete)
has been changed to Completable.subscribe(onComplete, onError)
to better match the callback order in the other base reactive classes, namely the most significant signal comes first (Observer.onNext
, SingleSubscriber.onSuccess
, and now CompletableSubscriber.onCompleted
).
The new RxJavaHooks API
PR #4007 introduced a new way of hooking into the lifecycle of the base reactive types (Observable
, Single
, Completable
) and the Scheduler
s. The original RxJavaPlugins
' design was too much focused on class-initialization time hooking and didn't properly allow hooking up different behavior after that. There is a reset()
available on it but sometimes that doesn't work as expected.
The new class rx.plugins.RxJavaHooks
allows changing the hooks at runtime, allowing tests to temporarily hook onto an internal behavior and then un-hook once the test completed.
RxJavaHooks.setOnObservableCreate(s -> {
System.out.println("Observable created");
return s;
});
Observable.just(1).subscribe(System.out::println);
RxJavaHooks.reset();
// or
RxJavaHooks.setOnObservableCreate(null);
It is now also possible to override what Scheduler
s the Schedulers.computation()
, .io()
and .newThread()
returns without the need to fiddle with Schedulers
' own reset behavior:
RxJavaHooks.setOnComputationScheduler(current -> Schedulers.immediate());
Observable.just(1).subscribeOn(Schedulers.computation())
.subscribe(v -> System.out.println(Thread.currentThread()));
By default, all RxJavaHooks
delegate to the original RxJavaPlugins
callbacks so if you have hooks the old way, they still work. RxJavaHooks.reset()
resets to this delegation and RxJavaHooks.clear()
clears all hooks (i.e., everything becomes a pass-through hook).
API enhancements
- Pull 3966: Add multi-other
withLatestFrom
operators. - Pull 3720: Add vararg of
Subscription
s to composite subscription. - Pull 4034:
distinctUntilChanged
with direct value comparator - alternative. - Pull 4036: Added zip function with Observable array.
- Pull 4020: Add
AsyncCompletableSubscriber
that exposesunsubscribe()
. - Pull 4011: Deprecate
TestObserver
, enhanceTestSubscriber
a bit. - Pull 4007: new hook management proposal
- Pull 4173: allow customizing GenericScheduledExecutorService via RxJavaHooks
- Pull 3931: add
groupBy
overload withevictingMapFactory
- Pull 4140: Change
Completable.subscribe(onError, onComplete)
to(onComplete, onError)
- Pull 4154: Ability to create custom schedulers with behavior based on composing operators via
Scheduler.when
. - Pull 4179: New
fromAsync
to bridge the callback world with the reactive.
API deprecations
- Pull 4011: Deprecate
TestObserver
, enhanceTestSubscriber
a bit. - Pull 4007: new hook management proposal (deprecates some
RxJavaPlugins
methods).
Performance enhancements
- Pull 4097: update
map()
andfilter()
to implementOnSubscribe
directly. - Pull 4176: Optimize collect, reduce and takeLast(1)
Bugfixes
1.1.6
Version 1.1.6 - June 15, 2016 (Maven)
API enhancements
- Pull 3934:
TestSubscriber
extra info on assertion failures - Pull 3948: add
Completable.andThen(Completable)
- Pull 3942: add
Completable.subscribe
to be safe, addunsafeSubscribe
option +RxJavaPlugins
hook support - Pull 3936: promote
UnicastSubject
to be a standard+experimentalSubject
- Pull 3971: add
Observable.rebatchRequests
operator to change and stabilize request amounts of the downstream. - Pull 3986: add
Schedulers.reset()
for better testing - Pull 3918:
ReplaySubject
now supports backpressure
API deprecations
- Pull 3948 deprecate
Completable.endWith()
in favor ofandThen()
Performance enhancements
- Pull 3470:
replay
request coordination reduce overhead
Bugfixes
- Pull 3924: fix
RxRingBuffer
-pool depending on thecomputation
scheduler - Pull 3922: fix
using()
resource cleanup when factory throws or being non-eager - Pull 3941: fix
Single.flatMap
not composing subscription through - Pull 3958: fix
just()
construction to call theonCreate
execution hook - Pull 3977: Use the correct
Throwable
to set the cause forCompositeException
- Pull 4005: Fix Spsc queues reporting not empty but then poll() returns null.