Monix: Version 2.2.1 Final Release
2.2.1 is out now.
It is a major release that shouldn’t be considered binary compatible with
even though it is source compatible. This is due to several operators being
Task, but extension methods are provided for the older
versions, therefore source compatibility is maintained.
As a summary: the new
MVar synchronization primitive, performance improvements
Observable.concatMap and in the
Task run-loop, new
interface for shutting down schedulers, bug fixes and upgrade to Cats 0.9.0.
See details below.
New Synchronization Primitive: monix.eval.MVar
MVar is a new synchronization primitive, a mutable location that can
be empty or contains a value, asynchronously blocking reads when empty and
blocking writes when full.
- As synchronized, thread-safe mutable variables
- As channels, with
putacting as “receive” and “send”
- As a binary semaphore, with
putacting as “acquire” and “release”
SchedulerService: for shutting down Schedulers
Sometimes there’s a need to create a temporary
Scheduler whose resources
need to be discarded. The new
SchedulerService is a new interface that
awaitTermination methods to the base
similar in spirit with
Task run-loop has suffered from a performance regression in version 2.1.x,
due to safety reasons.
In this new release I managed to eliminate that regression and right now the Monix Task has the best throughput among all the similar data type implementations in Scala land, see github.com/rossabaker/benchmarks/pull/4.
Observable also has performance improvements in
concatMap, which is now
getAndSet platform intrinsics from Java 8 to speed up the
concurrency for the handling of
onComplete. If you’re into JVM concurrency, the
implementation is beautiful ;-)
In addition to that,
Observable has performance improvements for the
bufferSliding operator, as it was revealed in a recent benchmark
that it had terrible performance. Now it is fine :-)
The full list of changes (with descriptions below):
- Issue #298: Don’t publish empty jars in root projects
- Issue #300: Update to cats 0.9.0
- Issue #301:
MVar, a non-blocking Task-based implementation
- Issue #303: Observable “doOn” operators refactoring
- Issue #281:
Fix performance regression in
- Issue #284:
- Issue #285:
Task.runAsync(f: Try[A] => Unit)to
- Issue #286:
- Issue #287:
- Issue #266:
- Issue #288:
Task.createshould not force async boundary
- Issue #289:
Observable.foreachshould not fork
- Issue #291:
- Issue #292:
- Issue #294:
- Issue #295:
- Issue #296:
- Issue #305:
Fix stack-overflow error in
To use the new version, include this in your
build.sbt (and use
%%% for Scala.js):
libraryDependencies += "io.monix" %% "monix" % "2.2.1"
The other projects from the @Monix organization have also been upgraded to depend on this new version.
shade, the Scala Memcached client:
dependencies += "io.monix" %% "shade" % "1.9.1"
monix-kafka, the Apache Kafka integration:
// For Kafka 8 libraryDependencies += "io.monix" %% "monix-kafka-8" % "0.10" // For Kafka 9 libraryDependencies += "io.monix" %% "monix-kafka-9" % "0.10" // For Kafka 10 libraryDependencies += "io.monix" %% "monix-kafka-10" % "0.10"