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.
(Since version 3.0.0) Switch to executeWithOptions(_.enableAutoCancelableRunLoops)
DEPRECATED — replace with usage of Task.runSyncStep:
DEPRECATED — replace with usage of Task.runSyncStep:
task.coeval <-> Coeval(task.runSyncStep)
(Since version 3.0.0-RC2) Replaced with Coeval(task.runSyncStep)
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
(Since version 3.0.0) Please use flatMap
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
and map
,
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))
(Since version 3.0.0) Please rewrite in terms of flatMap
DEPRECATED — renamed to executeAsync.
DEPRECATED — renamed to executeAsync.
The reason for the deprecation is the repurposing of the word "fork".
(Since version 3.0.0) Renamed to Task!.executeAsync
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
as fork
from 3.0.0-RC1
(Since version 3.0.0-RC2) Replaced with start
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.
(Since version 3.0.0) Renamed to Task.runToFuture
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.
(Since version 3.0.0) Renamed to Task.runAsyncOpt
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 of runOnComplete
with:
task.runAsync(Callback.fromTry(f))
A more common usage is via Scala's Promise
, but with
a Promise
reference this construct would be even more
efficient:
task.runAsync(Callback.fromPromise(p))
(Since version 3.0.0) Please use Task.runAsync
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.
(Since version 3.0.0) Please use Task.runSyncStep
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.
(Since version 3.0.0) Please use Task.runAsyncOpt
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]
(Since version 3.0.0-RC3) Switch to task.to[IO]
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
on Either
and others (i.e. the function for error recovery is at the left).
(Since version 3.0.0-RC2) Please use Task.redeem
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
on Either
and others (i.e. the function for error recovery is at the left).
(Since version 3.0.0-RC2) Please use Task.redeemWith
DEPRECATED — switch to Task.parZip2, which has the same behavior.
DEPRECATED — switch to Task.parZip2, which has the same behavior.
(Since version 3.0.0-RC2) Switch to Task.parZip2
DEPRECATED — switch to Task.parMap2, which has the same behavior.
DEPRECATED — switch to Task.parMap2, which has the same behavior.
(Since version 3.0.0-RC2) Use Task.parMap2
Deprecated operations, described as extension methods.