Monix: Version 3.0.0-RC1

The 3.0.0 release is near and it’s going to be huge. This is the first of the two release candidates planned, see below for the timeline.

The theme of the 3.x series are:

  1. deep integration with Typelevel Cats
  2. deep integration with cats-effect
  3. a much improved Task, in concert with its cats-effect integration
  4. improvements across the board to Observable, CancelableFuture, etc.
  5. the introduction of monix.tail.Iterant, a purely functional, pull-based streaming alternative

Featured presentation:

Milestones #

This release candidate is the first of two release candidates to follow. The remaining milestones are these:

  1. 3.0.0-RC2 to be released on April 15, 2018
  2. 3.0.0 to be released on May 15, 2018

These dates are synchronized with the milestones of cats-effect:

  1. 1.0.0-RC on April 15, 2018
  2. 1.0.0 on May 15, 2018

On API compatibility, going forward we’ll try our best to keep it and to re-add symbols that were removed from 2.x to ease migration, but until RC2 that is a best effort, due to cats-effect planned API breakage in its 1.0.0. But from RC2 onwards, you should expect both source and binary compatibility.

Upgrading #

To use the new version, include this in your build.sbt:

libraryDependencies += "io.monix" %% "monix" % "3.0.0-RC1"

Note this depends on Cats 1.1.0 and cats-effect 0.10!

Changes #

We haven’t announced any milestones on the website, due to their instability, therefore here’s the full list of changes that happened since the currently stable 2.3.x:

3.0.0-RC1 #

Cats Effect integration:

  • PR #598: Integrates cats.effect.Timer and IO.cancelable
  • PR #600: Add Sync & Async instances for Iterant
  • PR #607: implement ConcurrentEffect[Task] (upgrade to cats-effect 0.10)
  • PR #609: update Cats to 1.1.0 & Cats Effect to 0.10

Features for monix-execution:

  • PR #527 (#517, #525 and #526): removes macros, replacing them with plain extension methods, removes SerialCancelable#orderedUpdate
  • PR #556: SchedulerService.awaitTermination and fix concurrency tests
  • PR #584 (#221): add conversions module for the Java 8 CompletableFuture

Features for monix-eval:

  • PR #507: add onErrorRestartLoop for Task and Coeval
  • PR #533 (#523): add Task.fork operator, deprecate old Task.fork and executeWithFork, renamed to executeAsync
  • PR #530 (#520): add Task.forkAndForget
  • PR #537 (#535): Make MVar constructors return Task
  • PR #540 (#539): make all Task abstractions referentially transparent
  • PR #545 (#538): add newtype for Task.Par, using same encoding used in cats-effect
  • PR #547 (#542): add Task.runSyncUnsafe
  • PR #550: add Task.sleep, refactor the implementation of delayExecution and delayResult and deprecate delayExecutionWith and delayResultBySelector
  • PR #482 (#477): add the .cancelable operator on Task
  • PR #561: Bracket for Task / Coeval, Task.cancelable and Task.onCancelRaiseError
  • PR #596: add Fiber interface, refactor memoize for Task and Coeval
  • PR #602: TaskLocal should expose Local
  • PR #603: Changed implementation TaskLocal#bind in terms of Task#bracket

Features for monix-reactive:

  • PR #511 (#269): add monix.reactive.subjects.Var type
  • PR #528: add Observable.scanMap operator
  • PR #536 (#459): add a NonEmptyParallel for Observable using combineLatest

Features for monix-tail:

  • PR #503 (#487): add Iterant.liftF builder for lifting monadic values
  • PR #510 (#500): add Iterant.takeEveryNth operator
  • PR #504 (#499): add Iterant.switchIfEmpty operator
  • PR #509 (#495): add Iterant.dropLast operator
  • PR #508 (#501): add Iterant.intersperse operator
  • PR #512 (#496): add Iterant.dropWhileWithIndex operator
  • PR #514 (#497): add Iterant.takeWhileWithIndex operator
  • PR #523 (#519): add Iterant.scanMap operator
  • PR #518 (#516): add Iterant[Task].intervalAtFixedRate
  • PR #524 (#498): add Iterant.interleave
  • PR #549 (#548): add Iterant.fromStateAction and fromStateActionL
  • PR #567 (related to #563): completeL should handle F[_] errors, mapEval should not
  • PR #569 (related to #563): Iterant fold left operators (yielding F[_]) need to handle errors thrown in F[_]
  • PR #566 (#562): improve safety of attempt & onErrorHandleWith on Iterant
  • PR #578 (#570): add Iterant#sumL method
  • PR #579 (#577): make Iterant#reduceL and headOptionL left folds handle errors from F[_] context
  • PR #575 (##571 and #572): add Iterant.repeat (method and builder)
  • PR #583 (#549): add Iterant.fromStateAction builder
  • PR #582 (#573 and #574): add repeatEval/repeatEvalF for Iterant & repeatEvalF for Observable
  • PR #554 (#479): add Iterant#bracket operator
  • PR #581 (#559): handle broken nodes in Iterant.skipSuspendL
  • PR #589: improve handling of broken batches/cursors in Iterant.attempt
  • PR #591 (#580): improve strictness of Eq of Iterant, fix doOnFinish on Last

Bug fixes:

  • PR #552 (#483): MVar is stack unsafe, triggering stack overflow on put
  • PR #543 (#541): Observable.take(0) shouldn’t subscribe to the source at all
  • PR #496 (#468): race condition for Observable in concatenation operators
  • PR #568: in Iterant.toReactivePublisher the cancel should be made by request()
  • PR #592 (#590): potential nontermination in Observable.zip[Map]

Chores:

  • PR #502: update SBT to 1.1
  • PR #488: add note about execution model for Observable.fromInputStream
  • PR #531 (related to #513): add automatic header creation on compilation
  • PR #557: disable automatic publishing, too dangerous
  • PR #546 (related to #513): add scalafmt.conf configuration
  • PR #565: correct small typo in doc of Task#executeOn
  • PR #576: fix comment mentioning Akka instead of Monix
  • PR #588: update copyright headers for Scala 2.11 source files
  • PR #605: Make concurrent Atomic tests more resilient to timeouts

3.0.0-M3 #

  • PR #464: updates dependencies, Scala to 2.12.4 and 2.11.12, JCTools to 2.1.1, Minitest to 2.0.0, Scala.js to 0.6.21
  • PR #462: Fix for timeoutTo to cancel source task directly after timeout
  • PR #444: Add localContextPropagation to Task.Options, implement tracing Local vars
  • PR 470: increase test coverage
  • PR #473: Fix issue where fromAsyncStateAction is not safe for user code
  • PR #485 and PR #489: Updates Cats to 1.0.1 and cats-effect to 0.8
  • PR #474: Task / Coeval Run-loop Optimizations, First Batch
  • PR #492: Second batch of optimizations
  • PR #494: Task.cancel as a pure action, along with .start, .race and .uncancelable

3.0.0-M2 #

  • PR #437: Added Iterant.zipWithIndex
  • PR #439: Added Iterant.dump
  • PR #441: Observable.mapParallelUnordered needs configurable overflow strategy
  • PR #445: Added ShiftedRunnable in monix.execution
  • PR #443: Iterant maxByL and minByL ops
  • PR #442: small fixes in takeWhileNotCanceled and runAsyncGetFirst docs
  • PR #450: Minor test description fix
  • PR #458: Updates to cats 1.0-RC1 and cats-effect 0.5, along with redesigning that integration, e.g. added cats.Parallel instance, Iterant.parZip and Iterant.parZipMap

3.0.0-M1 #

  • PR #370: introduced Cats and cats-effect as direct dependencies
  • PR #377: added Cats related conversions, along with naming changes for consistency (e.g. renamed Coeval.Attempt to Coeval.Eager)
  • PR #387: updated Cats to 1.0.0-MF, removed deprecated functions and classes
  • PR #397: standardizes on Cats-related naming, removes Coeval’s Comonad implementation
  • PR #398: re-adds instances for CoflatMap
  • PR #427: adds conversions from Cats to Observable

New monix-tail sub-project, exposing monix.tail.Iterant[F[_], A]:

  • PR #280: introduces Iterant[F[_], A] for pull-based streaming based on Task / Coeval
  • PR #396: adds the Iterant.scan operator
  • PR #403: adds Iterant.foldWhileLeftL and Iterant.foldWhileLeftEvalL operators
  • PR #404: adds Iterant existsL, forallL, changes Observable.foldWhileL (breaking change)
  • PR #402: adds Iterant.foldRightL operator
  • PR #405: adds Iterant ops - findL, foldL, maxL, minL, reduceL
  • PR #407: adds Iterant ops - countL, distinctUntilChanged, distinctUntilChangedByKey
  • PR #412: adds scanEval on both Iterant and Observable
  • PR #411: another naming consistency change between Observable and Iterant
  • PR #413: Iterant.bufferSliding, bufferTumbling and batched operators
  • PR #417 and PR #418: Reactive Streams implementation for Iterant

Improvements for monix-execution and CancelableFuture:

  • PR #390: changes for flatMap on CancelableFuture to cancel all involved futures (thanks to @larsrh)
  • PR #395: adds Cats type class implementations for CancelableFuture
  • PR #431: improvements to CancelableFuture to get rid of memory leak, also adding utils like CancelableFuture.async
  • PR #432: further fixes to CancelableFuture, since describing a cancellable flatMap is a hard problem
  • PR #418: adds flip convenience method to AtomicBoolean (thanks to @Wogan)

Improvements for monix-reactive and Observable:

  • PR #391: makes Observable concatenation (++) stack safe
  • PR #408: changes for Iterant and Cats consistency (make use of Eq and Order type classes, add foldF and foldL, remove distinct and distinctByKey)
  • PR #368: added the Observable.intersperse operator (thanks to @omainegra)
  • PR #384: added contramap method to Callback (thanks to @Wogan)
  • PR #425: gets rid of ObservableLike, makes Observable an abstract class where the operators are final, Pipe no longer has Observable’s operators, just transform

Improvements for monix-eval, Task and Coeval:

  • PR #410: Task and Coeval performance optimisations
  • PR #422: adds Task.shift, an innovation inspired by cats.effect.IO
  • PR #424: Task refactoring, gets rid of Task.OnFinish type alias
  • PR #430: Coeval and Task refactoring to the run methods for consistency, introduced map2, map3map6 on both Task and Coeval, renamed zipMap* to parMap2, parMap3parMap6 for Task

Administrative and build changes:

Special Thanks #

For this release I’d like to give warm thanks to:

They’ve been really active in solving issues, in providing feedback, but also in helping people on the Gitter channel ❤️

Enjoy!