implicit final class DeprecatedExtensions[+A] extends AnyVal with Extensions[A]
- Alphabetic
- By Inheritance
- DeprecatedExtensions
- Extensions
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val self: Task[A]
- Definition Classes
- DeprecatedExtensions → Extensions
- def toString(): String
- Definition Classes
- Any
Deprecated Value Members
- def cancelable: Task[A]
DEPRECATED — since Monix 3.0 the
Task
implementation has switched to auto-cancelable run-loops by default (which can still be turned off in its configuration).DEPRECATED — since Monix 3.0 the
Task
implementation has switched to auto-cancelable run-loops by default (which can still be turned off in its configuration).For ensuring the old behavior, you can use executeWithOptions.
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0) Switch to executeWithOptions(_.enableAutoCancelableRunLoops)
- def coeval(implicit s: Scheduler): Coeval[Either[CancelableFuture[A], A]]
DEPRECATED — replace with usage of Task.runSyncStep:
DEPRECATED — replace with usage of Task.runSyncStep:
task.coeval <-> Coeval(task.runSyncStep)
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC2) Replaced with Coeval(task.runSyncStep)
- def delayExecutionWith(trigger: Task[Any]): Task[A]
DEPRECATED — please use flatMap.
DEPRECATED — please use flatMap.
The reason for the deprecation is that this operation is redundant, as it can be expressed with
flatMap
, with the same effect:import monix.eval.Task val trigger = Task(println("do it")) val task = Task(println("must be done now")) trigger.flatMap(_ => task)
The syntax provided by Cats can also help:
import cats.syntax.all._ trigger *> task
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0) Please use flatMap
- def delayResultBySelector[B](selector: (A) => Task[B]): Task[A]
DEPRECATED — please use flatMap.
DEPRECATED — please use flatMap.
The reason for the deprecation is that this operation is redundant, as it can be expressed with
flatMap
andmap
, with the same effect:import monix.eval.Task val task = Task(5) val selector = (n: Int) => Task(n.toString) task.flatMap(a => selector(a).map(_ => a))
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0) Please rewrite in terms of flatMap
- def executeWithFork: Task[A]
DEPRECATED — renamed to executeAsync.
DEPRECATED — renamed to executeAsync.
The reason for the deprecation is the repurposing of the word "fork".
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0) Renamed to Task!.executeAsync
- def fork: Task[Fiber[A]]
DEPRECATED — subsumed by start.
DEPRECATED — subsumed by start.
To be consistent with cats-effect 1.1.0,
start
now enforces an asynchronous boundary, being exactly the same asfork
from 3.0.0-RC1- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC2) Replaced with start
- def runAsync(implicit s: Scheduler): CancelableFuture[A]
DEPRECATED — renamed to runToFuture, otherwise due to overloading we can get a pretty bad conflict with the callback-driven Task.runAsync.
DEPRECATED — renamed to runToFuture, otherwise due to overloading we can get a pretty bad conflict with the callback-driven Task.runAsync.
The naming is also nice for discovery.
- Definition Classes
- Extensions
- Annotations
- @UnsafeBecauseImpure() @deprecated
- Deprecated
(Since version 3.0.0) Renamed to Task.runToFuture
- def runAsyncOpt(implicit s: Scheduler, opts: Options): CancelableFuture[A]
DEPRECATED — renamed to runAsyncOpt, otherwise due to overloading we can get a pretty bad conflict with the callback-driven Task.runToFutureOpt.
DEPRECATED — renamed to runAsyncOpt, otherwise due to overloading we can get a pretty bad conflict with the callback-driven Task.runToFutureOpt.
The naming is also nice for discovery.
- Definition Classes
- Extensions
- Annotations
- @UnsafeBecauseImpure() @deprecated
- Deprecated
(Since version 3.0.0) Renamed to Task.runAsyncOpt
- def runOnComplete(f: (Try[A]) => Unit)(implicit s: Scheduler): Cancelable
DEPRECATED — switch to Task.runToFuture in combination with Callback.fromTry instead.
DEPRECATED — switch to Task.runToFuture in combination with Callback.fromTry instead.
If for example you have a
Try[A] => Unit
function, you can replace usage ofrunOnComplete
with:task.runAsync(Callback.fromTry(f))
A more common usage is via Scala's
Promise
, but with aPromise
reference this construct would be even more efficient:task.runAsync(Callback.fromPromise(p))
- Definition Classes
- Extensions
- Annotations
- @UnsafeBecauseImpure() @deprecated
- Deprecated
(Since version 3.0.0) Please use
Task.runAsync
- def runSyncMaybe(implicit s: Scheduler): Either[CancelableFuture[A], A]
DEPRECATED — switch to Task.runSyncStep or to Task.runToFuture.
DEPRECATED — switch to Task.runSyncStep or to Task.runToFuture.
The runToFuture operation that returns CancelableFuture will return already completed future values, useful for low level optimizations. All this
runSyncMaybe
did was to piggyback on it.The reason for the deprecation is to reduce the unneeded "run" overloads.
- Definition Classes
- Extensions
- Annotations
- @UnsafeBecauseImpure() @deprecated
- Deprecated
(Since version 3.0.0) Please use
Task.runSyncStep
- def runSyncMaybeOpt(implicit s: Scheduler, opts: Options): Either[CancelableFuture[A], A]
DEPRECATED — switch to Task.runSyncStepOpt or to runAsync.
DEPRECATED — switch to Task.runSyncStepOpt or to runAsync.
The runAsyncOpt variant that returns CancelableFuture will return already completed future values, useful for low level optimizations. All this
runSyncMaybeOpt
did was to piggyback on it.The reason for the deprecation is to reduce the unneeded "run" overloads.
- Definition Classes
- Extensions
- Annotations
- @UnsafeBecauseImpure() @deprecated
- Deprecated
(Since version 3.0.0) Please use
Task.runAsyncOpt
- def toIO(implicit eff: ConcurrentEffect[Task]): IO[A]
DEPRECATED — replace with usage of Task.to:
DEPRECATED — replace with usage of Task.to:
import cats.effect.IO import monix.execution.Scheduler.Implicits.global import monix.eval.Task Task(1 + 1).to[IO]
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC3) Switch to task.to[IO]
- def transform[R](fa: (A) => R, fe: (Throwable) => R): Task[R]
DEPRECATED — use redeem instead.
DEPRECATED — use redeem instead.
Task.redeem is the same operation, but with a different name and the function parameters in an inverted order, to make it consistent with
fold
onEither
and others (i.e. the function for error recovery is at the left).- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC2) Please use
Task.redeem
- def transformWith[R](fa: (A) => Task[R], fe: (Throwable) => Task[R]): Task[R]
DEPRECATED — use redeemWith instead.
DEPRECATED — use redeemWith instead.
Task.redeemWith is the same operation, but with a different name and the function parameters in an inverted order, to make it consistent with
fold
onEither
and others (i.e. the function for error recovery is at the left).- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC2) Please use
Task.redeemWith
- def zip[B](that: Task[B]): Task[(A, B)]
DEPRECATED — switch to Task.parZip2, which has the same behavior.
DEPRECATED — switch to Task.parZip2, which has the same behavior.
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC2) Switch to Task.parZip2
- def zipMap[B, C](that: Task[B])(f: (A, B) => C): Task[C]
DEPRECATED — switch to Task.parMap2, which has the same behavior.
DEPRECATED — switch to Task.parMap2, which has the same behavior.
- Definition Classes
- Extensions
- Annotations
- @deprecated
- Deprecated
(Since version 3.0.0-RC2) Use Task.parMap2
This is the API documentation for the Monix library.
Package Overview
monix.execution exposes lower level primitives for dealing with asynchronous execution:
Atomic
types, as alternative tojava.util.concurrent.atomic
monix.catnap exposes pure abstractions built on top of the Cats-Effect type classes:
monix.eval is for dealing with evaluation of results, thus exposing Task and Coeval.
monix.reactive exposes the
Observable
pattern:Observable
implementationsmonix.tail exposes Iterant for purely functional pull based streaming:
Batch
andBatchCursor
, the alternatives to Scala'sIterable
andIterator
respectively that we are using within Iterant's encodingYou can control evaluation with type you choose - be it Task, Coeval, cats.effect.IO or your own as long as you provide correct cats-effect or cats typeclass instance.