Migrating from 1.x to 2.x
You are viewing the documentation for the older Monix 2.x series.
For the latest version: see here!
For the latest version: see here!
Package renamings:
monifu.concurrent->monix.executionmonifu.reactive->monix.reactive
Moved types:
monifu.reactive.Ack->monix.execution.Ackmonifu.reactive.observers.SynchronousObserver->monix.reactive.Observer.Syncmonifu.reactive.observers.SynchronousSubscriber->monix.reactive.observers.Subscriber.Syncmonifu.reactive.Subscriber->monix.reactive.observers.Subscribermonifu.concurrent.extensions->monix.execution.FutureUtils.extensions- the
atomic.paddedpackage inmonifu.concurrentis now gone, use theAtomic.withPaddingconstructor instead (default wasRight128) monifu.concurrent.async.AsyncQueueis nowmonix.execution.misc.AsyncQueue
Renamed operators:
Observable.lift->Observable.transformObservable.onSubscribe->Observable.unsafeSubscribeFn(this one changed signature as well, it now returns aCancelableinstead ofUnit)Observable.create->Observable.unsafeCreateand there’s a newObservable.createwith different behaviorAck.Cancel->Ack.Stop- for the
FutureUtilsextensionswithTimeoutwas renamed totimeoutandliftTrytomaterialize, for consistency withTask Observable.fromisObservable.applyandObservable.unitwas renamed toObservable.nowObservable.whileBusyDropEvents(onOverflow)renamed toObservable.whileBusyDropEventsAndSignalObservable.toReactive->toReactivePublisherCancelable.applynow wants aFunction0and not a by-name parameterObservable.doWork->Observable.doOnNextObservable.whileBusyBufferno longer takes anonOverflowhandler. TheonOverflowhandler is now a parameter of theOverflowStrategy(DropNewAndSignalandDropOldAndSignal)Observable.buffer->Observable.bufferTimedAndCountedObservable.asFutureis to be done asObservable.headL.runAsyncObservable.countis to be done asObservable.fromTask(Observable.countL)Observable.foldis to be done asObservable.foldL, now returning Task[T] not Future[Option[T]]
The Channel type is now gone, replaced by:
monix.reactive.Observer.Syncfor describing just synchronous inputmonix.reactive.subjects.ConcurrentSubjectfor describing synchronous input with attached output
Future no longer converts to Observable automatically. Use
Observable.fromFuture.