Monix: Version 3.0.0-RC2
This is the second release candidate for Monix 3, version 3.0.0-RC2.
The major theme of this release is compatibility with Cats-Effect
1.0.0.
Unfortunately we are late. See the announcement for the previous RC.
This release is 6 months late because of the work done on Cats-Effect
1.0.0, which involved several iterations of getting the contract of
those type classes right and then translating those changes into
Monix’s implementation. This included a major change in Iterant’s
encoding and a rewrite of most of its internals, and major changes in
Task’s internals as well.
Hopefully we can put all of this behind us and enjoy Monix 3 going forward. The current plan is:
- if nothing major (no bug) is discovered, the final 
3.0.0is scheduled in exactly two weeks from now, on November 20-th - hopefully binary compatibility is preserved from RC2, but note that promises of binary compatibility can’t really be made for release candidates, so this is a best effort promise
 
The good news is that this release comes with a ton of features …
Upgrading #
To use the new version, include this in your build.sbt:
libraryDependencies += "io.monix" %% "monix" % "3.0.0-RC2"
Note this depends on Cats 1.4.0 and cats-effect 1.0.0!
WARNING: the documentation on the website is currently not updated, only the ScalaDoc. All the docs will be updated in the following week or two.
Changes #
Cats-Effect Updates #
Supporting Cats-Effect 1.0.0 has been a massive amount of work:
- PR #659
Cats Effect 
1.0.0-RCupdate - PR #681:
Cats-Effect 
1.0.0-RC2update - PR #686:
Cats-Effect 
1.0.0-RC3update,Taskconversions - PR #716:
Updates to Cats-Effect 
1.0.0 
Also related, but mentioned below:
Iterant’s encoding had to change due to the new contract of Cats-Effect’s type classes, in a massive change of internals that also improved its performance and safety (#683)Taskchanges for back-pressuring on finalizers (#726)- The introduction of the 
monix-catnapsub-project along with the deprecation ofTaskSemaphore,TaskCircuitBreaker,MVar, being replaced with generic versions in themonix.catnappackage (see below) 
Sub-project: monix-execution #
Several features, deprecations and refactorings happened in
monix-execution, mentioned under the changes for monix-catnap
below:
monix.execution.misc.AsyncVarwas refactored, to have an interface in line with theMVarin Cats-Effect and moved tomonix.execution.AsyncVar(#753)monix.execution.misc.AsyncSemaphorewas also refactored and enhanced, with an interface resembling that of Cats-Effect’sSemaphoreand moved tomonix.execution.Semaphore(#754)monix.execution.AsyncQueuewas added (#757)monix.execution.Callbackwas added (#740)monix.execution.FutureUtilsandCancelableFuturecan now take care of the conversions of Scala’sFutureto and from Java’sCompletableFuture(#761)
Other features:
- PR #675:
Switches to stdlib 
NonFatal - PR #738:
Adds 
CancelablePromise - PR #765:
Changes 
TrampolineScheduler’s internal stack back to a queue 
Sub-project: monix-catnap #
This is a new project introduced that currently depends on only
monix-execution and Cats/Cats-Effect and whose purpose is to provide
abstractions built on top of Cats-Effect’s type classes.
- PR #744:
Adds 
monix.catnap.CircuitBreakerandLiftFuture - PR #753:
Adds generic 
monix.catnap.MVarandmonix.execution.AsyncVarrefactoring - PR #756:
Makes 
MVarfork on asynctakefor fairness - PR #754:
Adds generic 
monix.catnap.Semaphoreandmonix.execution.AsyncSemaphorerefactoring - PR #757:
Adds 
monix.execution.AsyncQueueandmonix.catnap.ConcurrentQueue - PR #762:
Fixes issue typelevel/cats-effect#403,
also added 
monix.catnap.cancelables.SingleAssignCancelableF 
Also mentioned below, as part of other features:
- Added 
monix.catnap.CancelableFandmonix.catnap.cancelables.BooleanCancelableF(#726) 
Note: the new FutureLift type class provides some of the
functionality of the now deprecated monix-java8.
Sub-project: monix-eval #
Major removals (with deprecation symbols kept around):
monix.eval.TaskSemaphore, replaced by the genericmonix.catnap.Semaphoremonix.eval.MVar, replaced by the genericmonix.catnap.MVarmonix.eval.TaskCircuitBreaker, replaced by the genericmonix.catnap.CircuitBreaker
This was done because having these implementations specialized for
Task doesn’t make sense and the new implementations are better and
have more features.
Features:
- PR #626:
Adds 
foreverforTask - PR #636:
Adds 
jointo theforkdocumentation - PR #639:
Makes 
Coeval.valueempty-parens to indicate side effects - PR #638:
Fixes 
Task.foreachwaiting / error reporting - PR #634:
Adds ability to specify custom options on 
Effect[Task] - PR #655:
Handles 
InterruptedExceptioninNonFatal - PR #660:
Makes 
TaskAppscheduler and options defs - PR #664:
Fixes 
Task.map2not executing things in sequence - PR #661:
Makes 
mapBothalways execute tasks in parallel - PR #669
Adds 
uncancelableto example - PR #647:
Changes internal encoding for 
Task.Async(major!) - PR #670:
Taskgets smarter about forking and async boundaries - PR #652:
Uses 
TaskLocal#localinTaskLocal#bindLandTaskLocal#bindClear - PR #679:
Fixes 
Task.bracket,onCancelRaiseError; introduceTask.ContextSwitch - PR #706:
Adds 
SemigroupK[Task]instance - PR #715:
Implements Task 
timedmethod - PR #724:
Makes 
Taskauto-cancelable by defaul (major!) - PR #725:
Adds runtime check to 
TaskLocalto make it safer - PR #726:
Changes 
Taskto sequence (back-pressure) async finalizers (major!) - PR #732:
Adds 
guaranteeandguaranteeCasemethods onTaskandCoeval - PR #740:
Moves 
Callbacktomonix.execution, TaskrunAsyncrefactor, rename torunToFuture(major!) - PR #761:
Expands 
FutureLiftto take care ofCompletableFuture 
Sub-project: monix-reactive #
Observable suffered an API refactoring, changing the convention for
operators that take Task or F[_] : Effect values as arguments:
- operators using 
Tasknow use theEvalsuffix instead ofTask, or no special suffix at all - operators using 
F[_] : Syncparameters use anFsuffix - the 
Fsuffixed operators previously signalled operators that kept theObservablecontext (e.g.findF), however all of them have been renamed 
See PR #729 for details.
Features:
- PR #610: 
Adds 
scan0,flatScan0,flatScan0DelayErrors,scanEval0,scanMap0onObservable - PR #641:
Reference 
bufferTumblinginstead ofbufferin scaladoc - PR #646:
Fixes 
ack.futurecalled whenAckisnull - PR #657:
Adds a few missing tests to 
Observablemethods - PR #684:
Simplifies logic in 
TakeLastOperator.onNext - PR #704:
Introduces 
Observable.doOnStartTaskandObservable.doOnStartEval - PR #723:
Adds 
Alternativeinstance forObservable - PR #654:
Makes 
Observable#++’s argument lazy - PR #729:
Adds 
Observable.bracket, Iterant/Task API refactorings, fixes (major!) - PR #741:
Adds cats 
Profunctorinstance forSubject - PR #739:
Adds operator 
bufferTimedWithPressurewithsizeOfonObservable - PR #743:
Improvs 
Observable.collectto avoid double evaluation - PR #749:
Adds 
ProfunctorandContravariantinstance forConsumer - PR #750:
Fixes handling start/end of 
Longrange inRangeObservable - PR #558:
Adds 
Observable.mapParallelOrdered 
Sub-project: monix-tail #
The Iterant encoding suffered a major change, with all operators
described for Iterant being changed for it. This was done because:
- the old encoding couldn’t be supported under the auto-cancelable model promoted by Cats-Effect 1.0.0
 - the new encoding is safer and has better performance too
 
Features:
- PR #683: Iterant, version 2 (major)
 - PR #614:
Adds 
scan0,scanEval0,scanMap0onIterant - PR #622:
Adds 
mapBatchforIterant - PR #629:
Fixes 
IterantBuildersSyncmethods to not requireimplicit F: Sync[F] - PR #631:
Renames 
toGeneratortotoBatchinCursor - PR #633:
Fixes eagerness of 
.bracketonLastnodes - PR #621:
Changes behavior of 
Batch#fromArray,fromAnyArray - PR #656:
Makes Iterant’s 
++take a lazy (by-name) parameter - PR #662:
Adds 
Iterant.fromReactivePublisher - PR #709:
Removes unused function from 
EvalOnNextAck - PR #707:
Add 
Iterant.lastOptionL - PR #746:
Fix 
Iterant.fromReactivePublisher - PR #755:
Remove the 
Sync[Iterant]instance 
Sub-project deprecation: monix-java8 #
The functionality in monix-java8 was implemented directly in:
monix.execution.FutureUtilsmonix.execution.CancelableFuturemonix.catnap.FutureLift
The monix-java8 sub-project is still provided, but is deprecated and
will soon be removed.
Chores #
- PR #653: Update Monix’s rootdoc, the landing page for the ScalaDoc
 - PR #671: Optionally allow forcing a build on Java 9+
 - PR #677: Add Starting Point section to CONTRIBUTING.md
 - PR #693:
Fix micro doc typo in 
monix.execution.misc.InlineMacros - PR #699:
Add 
ConcatandScopetoIterant’s description - PR #640: Add sbt-doctest, to verify code examples in ScalaDoc
 - PR #705:
Fix all ScalaDocs (except Task’s) in 
monix.eval - PR #717: Change to Scala’s Code of Conduct
 - PR #720: Add @Avasil to the Code of Conduct
 - PR #718:
Fix 
TaskScalaDocs - PR #736: Update doctest plugin version
 - PR #763: Fix Observable doc mentioning cats.Eq
 
Thanks #
People that made this release possible, in alphabetical order:
- Alexandru Nedelcu (@alexandru)
 - Eduardo Barrientos (@kdoomsday)
 - Eugene Platonov (@jozic)
 - Jakub Kozłowski (@kubukoz)
 - Jamie Wilson (@jfwilson)
 - Joe Ferris (@jferris)
 - Jules Ivanic (@guizmaii)
 - Kacper Gunia (@cakper)
 - Kamil Kloch (@kamilkloch)
 - Loránd Szakács (@lorandszakacs)
 - Oleg Pyzhcov (@oleg-py)
 - Piotr Gawryś (@Avasil)
 - Raas A (@RaasAhsan)
 - Seth Tisue (@SethTisue)
 - Yohann B (@ybr)
 - jendakol (@jendakol)
 - volth (@volth)