Releases: ReactiveX/RxJava
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 Schedulers. 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 Schedulers 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
withLatestFromoperators. - Pull 3720: Add vararg of
Subscriptions to composite subscription. - Pull 4034:
distinctUntilChangedwith direct value comparator - alternative. - Pull 4036: Added zip function with Observable array.
- Pull 4020: Add
AsyncCompletableSubscriberthat exposesunsubscribe(). - Pull 4011: Deprecate
TestObserver, enhanceTestSubscribera bit. - Pull 4007: new hook management proposal
- Pull 4173: allow customizing GenericScheduledExecutorService via RxJavaHooks
- Pull 3931: add
groupByoverload 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
fromAsyncto bridge the callback world with the reactive.
API deprecations
- Pull 4011: Deprecate
TestObserver, enhanceTestSubscribera bit. - Pull 4007: new hook management proposal (deprecates some
RxJavaPluginsmethods).
Performance enhancements
- Pull 4097: update
map()andfilter()to implementOnSubscribedirectly. - Pull 4176: Optimize collect, reduce and takeLast(1)
Bugfixes
1.1.6
Version 1.1.6 - June 15, 2016 (Maven)
API enhancements
- Pull 3934:
TestSubscriberextra info on assertion failures - Pull 3948: add
Completable.andThen(Completable) - Pull 3942: add
Completable.subscribeto be safe, addunsafeSubscribeoption +RxJavaPluginshook support - Pull 3936: promote
UnicastSubjectto be a standard+experimentalSubject - Pull 3971: add
Observable.rebatchRequestsoperator to change and stabilize request amounts of the downstream. - Pull 3986: add
Schedulers.reset()for better testing - Pull 3918:
ReplaySubjectnow supports backpressure
API deprecations
- Pull 3948 deprecate
Completable.endWith()in favor ofandThen()
Performance enhancements
- Pull 3470:
replayrequest coordination reduce overhead
Bugfixes
- Pull 3924: fix
RxRingBuffer-pool depending on thecomputationscheduler - Pull 3922: fix
using()resource cleanup when factory throws or being non-eager - Pull 3941: fix
Single.flatMapnot composing subscription through - Pull 3958: fix
just()construction to call theonCreateexecution hook - Pull 3977: Use the correct
Throwableto set the cause forCompositeException - Pull 4005: Fix Spsc queues reporting not empty but then poll() returns null.
1.1.5
1.1.4
API enhancements
- Pull 3856: Provide factories for creating the default scheduler instances.
- Pull 3866: Add
Single.toCompletable(). - Pull 3879: Expose scheduler factories which accept thread factories.
- Pull 3820: Making RxPlugins
reset()public - Pull 3888: New operator:
onTerminateDetach- detach upstream/downstream for GC
API deprecations
- Pull 3871: Deprecate remaining public scheduler types.
Performance enhancements
- Pull 3761: optimize
merge/flatMapfor empty sources. - Pull 3864: optimize
concatMapIterable/flatMapIterable.
Bugfixes
- Pull 3868: Fix an unsubscribe race in
EventLoopWorker. - Pull 3867: ensure waiting tasks are cancelled on worker unsubscription.
- Pull 3862: fix
from(Iterable)error handling of Iterable/Iterator - Pull 3886:
throwIfFatal()now throwsOnCompletedFailedException. - Pull 3887: Have undeliverable errors on
subscribe()sent to plugin error handler. - Pull 3895:
cast()should unsubscribe on crash eagerly. - Pull 3896:
OperatorMapPairshould unsubscribe on crash eagerly. - Pull 3890:
map()andfilter()should unsubscribe on crash eagerly. - Pull 3893: enable backpressure with
from(Future) - Pull 3883: fix multiple chained
Single.doAfterTerminatenot calling actions - Pull 3904: Fix
CompletableswallowsOnErrorNotImplementedException - Pull 3905: fix
singleOrDefault()backpressure if source is empty
1.1.3
API enhancements
- Pull 3780:
SyncOnSubscribehas been promoted to@BetaAPI. - Pull 3799: Added
Completable.andThen(Single)operator - Pull 3777: Added
observeOnoverload to configure the prefetch/buffer size - Pull 3790: Make
Single.liftpublic and@Experimental - Pull 3818:
fromCallablepromotion to@Beta - Pull 3842: improve
ExecutorSchedulerworker unsubscription
API deprecations
- Pull 3762: Deprecate
CompositeExceptionconstructor with message prefix
General enhancements
- Pull 3828:
AsyncSubjectnow supports backpressure - Pull 3829: Added
rx.unsafe-disablesystem property to disable use ofsun.misc.Unsafeeven if it is available - Pull 3757: Warning: behavior change! Operator
sampleemits last sampled value before termination
Performance enhancements
- Pull 3795:
observeOnnow replenishes with constant rate
Bugfixes
- Pull 3809: fix
merge/flatMapcrash when the inner source wasjust(null) - Pull 3789: Prevent
Single.zip()of zeroSingles - Pull 3787: fix
groupBydelaying group completion till all groups were emitted - Pull 3823: fix
DoAfterTerminatehandle if action throws - Pull 3822: make defensive copy of the properties in
RxJavaPlugins - Pull 3836: fix
switchMap/switchOnNextproducer retention and backpressure - Pull 3840: fix
concatMapscalar/empty source behavior - Pull 3839: fix
takeLast()backpressure - Pull 3845: fix delaySubscription(Observable) unsubscription before triggered
Version 1.1.2 - March 18, 2016
API Enhancements
- Pull 3766: Add
Single.onErrorResumeNext(Func1)operator - Pull 3765: Add
Observable.switchOnNextDelayErrorandObservable.switchMapDelayErroroperators - Pull 3759: Add
Observable.concatDelayErrorandObservable.concatMapDelayErroroperators - Pull 3763: Add
Observable.combineLatestDelayErroroperator - Pull 3752: Add
Single.usingoperator - Pull 3722: Add
Observable.flatMapIterableoverload withmaxConcurrentparameter - Pull 3741: Add
Single.doOnSubscribeoperator - Pull 3738: Add
Observable.create(SyncOnSubscribe)andObservable.create(AsyncOnSubscribe)factory methods - Pull 3718: Add
Observable.concatMapIterableoperator - Pull 3712: Add
Single.takeUntil(Completable)operator - Pull 3696: Added Single execution hooks via
RxJavaSingleExecutionHookclass. Warning! This PR introduced a binary incompatible change ofSingle.unsafeSubscribe(Subscriber)by changing its return type fromvoidtoSubscription. - Pull 3487: Add
onBackpressureBufferoverflow strategies (oldest, newest, error)
API deprecations
- Pull 3701: deprecate
Completable.doOnCompletein favor ofCompletable.doOnCompleted(note the last d in the method name)
Performance enhancements
- Pull 3759: Add
Observable.concatDelayErrorandObservable.concatMapDelayErroroperators - Pull 3476: reduced
rangeandflatMap/mergeoverhead
Bugfixes
- Pull 3768: Fix
observeOnin-sequence termination/unsubscription checking - Pull 3733: Avoid swallowing errors in
Completable - Pull 3727: Fix
scannot requestingLong.MAX_VALUEfrom upstream if downstream has requestedLong.MAX_VALUE - Pull 3707: Lambda-based
Completable.subscribe()methods should reportisUnsubscribedproperly - Pull 3702: Fix
mapNotificationbackpressure handling - Pull 3697: Fix
ScalarSynchronousObservableexpecting theScheduler.computation()to beEventLoopsSchedulerall the time - Pull 3760: Fix ExecutorScheduler and GenericScheduledExecutorService reorder bug
- Pull 3678: Fix counted buffer and window backpressure
1.1.1
Version 1.1.1 - February 11, 2016 (Maven)
The new Completable class
- Pull 3444 Completable class to support valueless event composition + tests
What is this Completable class?
We can think of a Completable object as a stripped version of Observable where only the terminal events, onError and onCompleted are ever emitted; they may look like an Observable.empty() typified in a concrete class but unlike empty(), Completable is an active class. Completable mandates side effects when subscribed to and it is its main purpose indeed. Completable contains some deferred computation with side effects and only notifies about the success or failure of such computation.
Similar to Single, the Completable behavior can be emulated with Observable<?> to some extent, but many API designers think codifying the valuelessness in a separate type is more expressive than messing with wildcards (and usually type-variance problems) in an Observable chain.
Completable doesn't stream a single value, therefore, it doesn't need backpressure, simplifying the internal structure from one perspective, however, optimizing these internals requires more lock-free atomics knowledge in some respect.
Hello World!
Let's see how one can build a (side-effecting) Hello World Completable:
Completable.fromAction(() -> System.out.println("Hello World!"))
.subscribe();Quite straightforward. We have a set of fromXXX method which can take many sources: Action, Callable, Single and even Observable (stripping any values generated by the latter 3 of course). On the receiving end, we have the usual subscribe capabilities: empty, lambdas for the terminal events, a rx.Subscriber and a rx.Completable.CompletableSubscriber, the main intended receiver for Completables.
Further reading
API enhancements
- Pull 3434 Add Single.doAfterTerminate()
- Pull 3447 operator DelaySubscription with plain Observable
- Pull 3498 Rename cache(int) to cacheWithCapacityHint(int)
- Pull 3539 Add Single.zip() for Iterable of Singles
- Pull 3562 Add Single.doOnUnsubscribe()
- Pull 3566 Deprecate Observable.finallyDo() and add Observable.doAfterTerminate() instead
- Pull 3567 Implemented Observable#toCompletable
- Pull 3570 Implemented Completable#andThen(Observable)
- Pull 3627 Added MergeDelay operators for Iterable of Observables
- Pull 3655 Add Single.onErrorResumeNext(Single)
- Pull 3661 CombineLatest now supports any number of sources
- Pull 3682 fix observeOn resource handling, add delayError capability
- Pull 3686 Added retry and retryWhen support for Single
API deprecations
cache(int)via #3498, replaced bycacheWithCapacityHint(int)finallyDo(Action0)via #3566, replaced bydoAfterTerminate(Action0)
Performance improvements
- Pull 3477 add a source OnSubscribe which works from an array directly
- Pull 3579 No more need to convert Singles to Observables for Single.zip()
- Pull 3587 Remove the need for javac to generate synthetic methods
- Pull 3614 just() now supports backpressure
- Pull 3642 Optimizate single just
- Pull 3589 concat reduce overhead when streaming a source
Bugfixes
- Pull 3428 GroupBy backpressure fix
- Pull 3454 fix: bounded replay() not requesting enough for latecommers
- Pull 3467 compensate for drastic clock drifts when scheduling periodic tasks
- Pull 3555 fix toMap and toMultimap not handling exceptions of the callbacks
- Pull 3585 fix Completable.using not disposing the resource if the factory crashes during the subscription phase
- Pull 3588 Fix the initialization order in GenericScheduledExecutorService
- Pull 3620 Fix NPE in CompositeException when nested throws on initCause
- Pull 3630 ConcatMapEager allow nulls from inner Observables.
- Pull 3637 handle predicate exceptions properly in skipWhile
- Pull 3638 fix error handling in OperatorDistinctUntilChanged
- Pull 3639 fix error handling in onBackpressureBuffer
- Pull 3640 fix error handling in onBackpressureDrop
- Pull 3644 fix SyncOnSubscribe not signalling onError if the generator crashes
- Pull 3645 fix Amb sharing the choice among all subscribers
- Pull 3653 fix sample(Observable) not requesting Long.MAX_VALUE
- Pull 3658 fix unsubscription and producer issues in sample(other)
- Pull 3662 fix doOnRequest premature requesting
- Pull 3677 negative argument check for skip's count and merge's maxConcurrent
- Pull 3681 change publish(Func1) to use a dedicated subject-like dispatcher
- Pull 3688 Fix zip() - observer array becoming visible too early and causing NPE
- Pull 3689 unified onErrorX and onExceptionResumeNext and fixed backpressure
1.1.0
Version 1.1.0 – December 2 2015 (Maven Central)
- Pull 3550 Public API changes for 1.1.0 release
Promotions to Public API
- Subscriptions.unsubscribed
- Subscribers.wrap
- 2 RxJavaErrorHandler methods
- Single + SingleSubscriber
- Exceptions.throwIfAny
- Observable.switchIfEmpty with Observable
- BackpressureDrainManager
- Observable.onBackpressureLatest
- Observable.onBackpressureDrop with action
- Observable.onBackpressureBuffer overloads
- 2 Observable.merge overloads for maxConcurrent
- TestSubscriber methods
- Observable.takeUntil with predicate
Promotions to BETA
- ConnectableObservable.autoConnect
- Stateful Subject methods on ReplaySubject, PublishSubject, BehaviorSubject, and AsyncSubject
Experimental APIs Removed
- Observable.onBackpressureBlock
- rx.observables.AbstractOnSubscribe
- Removal of stateful methods from the generic rx.subjects.Subject abstract class
1.0.17
Version 1.0.17 – December 1 2015 (Maven Central)
- Pull 3150 Window operators now support backpressure in the inner observable
- Pull 3535 Don't swallow fatal errors in OperatorZipIterable
- Pull 3528 Avoid to call next when Iterator is drained
- Pull 3436 Add action != null check in OperatorFinally
- Pull 3513 Add shorter RxJavaPlugin class lookup approach