Releases: ReactiveX/RxJava
0.19.0
This release focused on performance and cleanup. If all goes according to plan the next release should be 0.20.0 with backpressure and then we will release 1.0 Release Candidate with the public API no longer allowing breaking changes.
Performance and Object Allocation
Fairly significant object allocation improvements are included in this release which reduce GC pressure and improve performance.
Two pull requests (amongst several) with details are:
With the following simple test code relative performance has increased as shown below:
Observable<Integer> o = Observable.just(1);
o.map(i -> {
return String.valueOf(i);
}).map(i -> {
return Integer.parseInt(i);
}).subscribe(observer);
Rx 0.19
Run: 10 - 10,692,099 ops/sec
Run: 11 - 10,617,627 ops/sec
Run: 12 - 10,938,405 ops/sec
Run: 13 - 10,917,388 ops/sec
Run: 14 - 10,783,298 ops/sec
Rx 0.18.4
Run: 11 - 8,493,506 ops/sec
Run: 12 - 8,403,361 ops/sec
Run: 13 - 8,400,537 ops/sec
Run: 14 - 8,163,998 ops/sec
Rx 0.17.6
Run: 10 - 4,930,966 ops/sec
Run: 11 - 6,119,951 ops/sec
Run: 12 - 7,062,146 ops/sec
Run: 13 - 6,514,657 ops/sec
Run: 14 - 6,369,426 ops/sec
Rx 0.16.1
Run: 10 - 2,879,355 ops/sec
Run: 11 - 3,236,245 ops/sec
Run: 12 - 4,468,275 ops/sec
Run: 13 - 3,237,293 ops/sec
Run: 14 - 4,683,840 ops/sec
Note that these numbers are relative as they depend on the JVM and hardware.
Scala Changes
Many missing operators have been added to the RxScala APIs along with fixes and other maturation.
toBlockingObservable() -> toBlocking()
The toBlockingObservable()
method has been deprecated in favor of toBlocking()
for brevity and fit better with possible future additions such as toParallel()
without always needing the Observable
suffix.
forEach
forEach
as added as an alias for subscribe
to match the Java 8 naming convention.
This means code can now be written as:
Observable.from(1, 2, 3).limit(2).forEach(System.out::println);
which is an alias of this:
Observable.from(1, 2, 3).take(2).subscribe(System.out::println);
Since forEach
exists on BlockingObservable
as well, moving from non-blocking to blocking looks like this:
// non-blocking
Observable.from(1, 2, 3).limit(2).forEach(System.out::println);
// blocking
Observable.from(1, 2, 3).limit(2).toBlocking().forEach(System.out::println);
Schedulers
Thread caching is restored to Schedulers.io()
after being lost in v0.18.
A replacement for ExecutorScheduler
(removed in 0.18) is accessible via Schedulers.from(Executor e)
that wraps an Executor
and complies with the Rx contract.
ReplaySubject
All "replay" functionality now exists directly on the ReplaySubject
rather than in an internal type. This means there are now several different create
methods with the various overloads of size and time.
Changelist
- Pull 1165 RxScala: Add dropUntil, contains, repeat, doOnTerminate, startWith, publish variants
- Pull 1183 NotificationLite.accept performance improvements
- Pull 1177 GroupByUntil to use BufferUntilSubscriber
- Pull 1182 Add facilities for creating Observables from JavaFX events and ObservableValues
- Pull 1188 RxScala Schedulers changes
- Pull 1175 Fixed synchronous ConnectableObservable.connect problem
- Pull 1172 ObserveOn: Change to batch dequeue
- Pull 1191 Fix attempt for OperatorPivotTest
- Pull 1195 SwingScheduler: allow negative schedule
- Pull 1178 Fix RxScala bug
- Pull 1210 Add more operators to RxScala
- Pull 1216 RxScala: Exposing PublishSubject
- Pull 1208 OperatorToObservableList: use LinkedList to buffer the sequence’s items
- Pull 1185 Behavior subject time gap fix 2
- Pull 1226 Fix bug in
zipWithIndex
and setzip(that, selector)
public in RxScala - Pull 1224 Implement shorter toBlocking as shorter alias for toBlockingObservable.
- Pull 1223 ReplaySubject enhancement with time and/or size bounds
- Pull 1160 Add
replay
andmulticast
variants to RxScala - Pull 1229 Remove Ambiguous Subscribe Overloads with Scheduler
- Pull 1232 Adopt Limit and ForEach Java 8 Naming Conventions
- Pull 1233 Deprecate toBlockingObservable in favor of toBlocking
- Pull 1237 SafeSubscriber memory reduction
- Pull 1236 CompositeSubscription with atomic field updater
- Pull 1243 Remove Subscription Wrapper from Observable.subscribe
- Pull 1244 Observable.from(T) using Observable.just(T)
- Pull 1239 RxScala: Update docs for "apply" and add an example
- Pull 1248 Fixed testConcurrentOnNextFailsValidation
- Pull 1246 Moved to atomic field updaters.
- Pull 1254 ZipIterable unsubscription fix
- Pull 1247 Add zip(iterable, selector) to RxScala
- Pull 1260 Fix the bug that BlockingObservable.singleOrDefault doesn't call unsubscribe
- Pull 1269 Fix the bug that int overflow can bypass the range check
- Pull 1272 ExecutorScheduler to wrap an Executor
- Pull 1264 ObserveOn scheduled unsubscription
- Pull 1271 Operator Retry with predicate
- Pull 1265 Add more operators to RxScala
- Pull 1281 Reduce Subscription Object Allocation
- Pull 1284 Lock-free, MPSC-queue
- Pull 1288 Ensure StringObservable.from() does not perform unnecessary read
- Pull 1286 Rename some Operator* classes to OnSubscribe*
- Pull 1276 CachedThreadScheduler
- Pull 1287 ReplaySubject remove replayState CHM and related SubjectObserver changes
- Pull 1289 Schedulers.from(Executor)
- Pull 1290 Upgrade to JMH 0.7.3
- Pull 1293 Fix and Update JMH Perf Tests
- Pull 1291 Check unsubscribe within observable from future
- Pull 1294 rx.operators -> rx.internal.operators
- Pull 1295 Change
void accept
toboolean accept
- Pull 1296 Move re-used internal Scheduler classes to their own package
- Pull 1298 Remove Bad Perf Test
- Pull 1301 RxScala: Add convenience method for adding unsubscription callback
- Pull 1304 Add flatMap and concatMap to RxScala
- Pull 1306 Hooked RxJavaPlugins errorHandler up within all operators that swallow onErrors
- Pull 1309 Hide ChainedSubscription/SubscriptionList from Public API
Artifacts: Maven Central
0.18.4
This is a fix for CompositeSubscription
object allocation problems. Details can be found in issue #1204.
- Pull 1283 Subscription object allocation fix
Artifacts: Maven Central
0.18.3
0.18.2
Continued work on migrating operators on path to 1.0 along with various bug fixes.
- Pull 1150 Fix ReplaySubject Terminal State Race Condition
- Pull 1144 Operator Delay rebase & fixes
- Pull 1142 Update 'contains' signature to 'contains(Object)'
- Pull 1134 OperatorTakeLast
- Pull 1135 OperatorTakeUntil
- Pull 1137 Random fixes to operators multicast, sample, refCount
- Pull 1138 Operator Window and other changes
- Pull 1131 Operator TakeTimed
- Pull 1130 Operator Switch
- Pull 1129 Conditional statements contribution to Operator
- Pull 1128 Fix for SerializedObserverTest
- Pull 1126 Operator When
- Pull 1125 Operator contrib math
- Pull 1124 Add lift to rxscala
- Pull 1122 OperatorSkipUntil
- Pull 1121 OperatorSkipTimed
- Pull 1120 OperatorSequenceEqual
- Pull 1119 OperatorRefCount
- Pull 1118 Operator ParallelMerge
- Pull 1117 Operator OnExceptionResumeNextViaObservable
- Pull 1115 OperatorTakeWhile
- Pull 1112 OperatorThrottleFirst
- Pull 1111 OperatorTimeInterval
- Pull 1110 OperatorOnErrorReturn
- Pull 1109 OperatorOnErrorResumeNextViaObservable
- Pull 1108 OperatorMulticastAndReplay
- Pull 1107 Fix ReplaySubject's double termination problem.
- Pull 1106 OperatorMergeMaxConcurrent
- Pull 1104 Operator merge delay error
- Pull 1103 OperatorJoin
- Pull 1101 Operator async
- Pull 1100 OperatorUsing
- Pull 1099 OperatorToMap
- Pull 1098 OperatorTimerAndSample
- Pull 1097 OperatorToMultimap
- Pull 1096 OperatorGroupJoin
- Pull 1095 OperatorGroupByUntil
- Pull 1094 Operator debounce
Artifacts: Maven Central
0.18.1
- Pull 1065 Optimize OperatorSkipLastTimed
- Pull 1073 OperatorBuffer
- Pull 1074 OperatorConcat
- Pull 1088 OperatorToObservableFuture
- Pull 1087 OperatorMergeMap
- Pull 1086 OperatorFinallyDo
- Pull 1085 OperatorDistinctUntilChanged
- Pull 1084 OperatorDistinct
- Pull 1083 OperatorDematerialize
- Pull 1081 OperatorDefer
- Pull 1080 OperatorDefaultIfEmpty
- Pull 1079 OperatorCombineLatest
- Pull 1074 OperatorConcat
- Pull 1073 OperatorBuffer
- Pull 1091 Handle Thrown Errors with UnsafeSubscribe
- Pull 1092 Restore ObservableExecutionHook.onCreate
Artifacts: Maven Central
0.18.0
This release takes us a step closer to 1.0 by completing some of the remaining work on the roadmap.
Scheduler
The first is simplifying the Scheduler API.
The Scheduler API is now simplified to this:
class Scheduler {
public abstract Worker createWorker();
public int parallelism();
public long now();
public abstract static class Worker implements Subscription {
public abstract Subscription schedule(Action0 action, long delayTime, TimeUnit unit);
public abstract Subscription schedule(Action0 action);
public Subscription schedulePeriodically(Action0 action, long initialDelay, long period, TimeUnit unit);
public long now();
}
}
This is a breaking change if you have a custom Scheduler
implementation or use a Scheduler
directly. If you only ever pass in a Scheduler
via the Schedulers
factory methods, this change does not affect you.
Additionally, the ExecutionScheduler
was removed because a general threadpool does not meet the requirements of sequential execution for an Observable
. It was replaced with rx.schedulers.EventLoopScheduler
which is the new default for Schedulers.computation()
. It is a pool of event loops.
rx.joins
The rx.joins
package and associated when
, and
and then
operators were moved out of rxjava-core into a new module rxjava-joins. This is done as the rx.joins API was not yet matured and is not going to happen before 1.0. It was determined low priority and not worth blocking a 1.0 release. If the API matures inside the separate module to the point where it makes sense to bring it back into the core it can be done in the 1.x series.
Deprecation Cleanup
This releases removes many of the classes and methods that have been deprecated in previous releases. Most of the removed functionality was migrated in previous releases to contrib modules such as rxjava-math, rxjava-async and rxjava-computation-expressions.
A handful of deprecated items still remain but can not yet be removed until all internal operators are finished migrating to using the lift
/Subscriber
design changes done in 0.17.0.
The full list of changes in 0.18.0:
- Pull 1047 Scheduler Simplification
- Pull 1072 Scheduler.Inner -> Scheduler.Worker
- Pull 1053 Deprecation Cleanup
- Pull 1052 Scheduler Cleanup
- Pull 1048 Remove ExecutorScheduler - New ComputationScheduler
- Pull 1049 Move rx.joins to rxjava-joins module
- Pull 1068 add synchronous test of resubscribe after error
- Pull 1066 CompositeSubscription fix
- Pull 1071 Manual Merge of AsObservable
- Pull 1063 Fix bugs in equals and hashCode of Timestamped
- Pull 1070 OperationAny -> OperatorAny
- Pull 1069 OperationAll -> OperatorAll
- Pull 1058 Typo in javadoc
- Pull 1056 Add drop(skip) and dropRight(skipLast) to rxscala
- Pull 1057 Fix: Retry in Scala adaptor is ambiguous
- Pull 1055 Fix: Missing Quasar instrumentation on Observable$2.call
- Pull 1050 Reimplement the 'SkipLast' operator
- Pull 967 Reimplement the 'single' operator
Artifacts: Maven Central
0.17.6
- Pull 1031 Fix NPE in SubjectSubscriptionManager
- Pull 1030 Benchmarking: Add JMH benchmark for ReplaySubject
- Pull 1033 isolate subscriber used for retries, cleanup tests
- Pull 1021 OperatorWeakBinding to not use WeakReferences anymore
- Pull 1005 add toMap from Java Observable
- Pull 1040 Fixed deadlock in Subjects + OperatorCache
- Pull 1042 Kotlin M7 and full compatibility with 0.17.0
- Pull 1035 Scala cleanup
- Pull 1009 Android - Adding a new RetainedFragment example
- Pull 1020 Upgrade Gradle wrapper for Android samples to Gradle 1.11
- Pull 1038 rxjava-android: parameterize OperatorViewClick by concrete view type
Artifacts: Maven Central
0.17.5
- Pull 1010 Observable.unsafeSubscribe
- Pull 1015 Remove Redundant protectivelyWrap Method
- Pull 1019 Fix: retry() never unsubscribes from source until operator completes
Artifacts: Maven Central
0.17.4
This release adds a new contrib module with a Scheduler
supporting lightweight threads or "fibers" via Quasar.
- Pull 990 Quasar Lightweight Threads/Fibers Contrib Module
- Pull 1012 SerializedObserver: Removed window between the two synchronized blocks
Artifacts: Maven Central