DeprecatedExtensions
Deprecated operations, described as extension methods.
Deprecated operations, described as extension methods.
Value members
Deprecated and Inherited methods
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.
- Deprecated
- Inherited from
- Extensions
DEPRECATED — replace with usage of Task.runSyncStep:
DEPRECATED — replace with usage of Task.runSyncStep:
task.coeval <-> Coeval(task.runSyncStep)
- Deprecated
[Since version 3.0.0-RC2]
- Inherited from
- Extensions
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
- Deprecated
- Inherited from
- Extensions
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))
- Deprecated
- Inherited from
- Extensions
DEPRECATED — renamed to executeAsync.
DEPRECATED — renamed to executeAsync.
The reason for the deprecation is the repurposing of the word "fork".
- Deprecated
- Inherited from
- Extensions
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.
- Deprecated
[Since version 3.0.0]
- Inherited from
- Extensions
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.
- Deprecated
[Since version 3.0.0]
- Inherited from
- Extensions
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))
- Deprecated
[Since version 3.0.0]
- Inherited from
- Extensions
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.
- Deprecated
[Since version 3.0.0]
- Inherited from
- Extensions
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.
- Deprecated
[Since version 3.0.0]
- Inherited from
- Extensions
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).
- Deprecated
[Since version 3.0.0-RC2]
- Inherited from
- Extensions
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).
- Deprecated
[Since version 3.0.0-RC2]
- Inherited from
- Extensions
DEPRECATED — switch to Task.parZip2, which has the same behavior.
DEPRECATED — switch to Task.parZip2, which has the same behavior.
- Deprecated
[Since version 3.0.0-RC2]
- Inherited from
- Extensions
DEPRECATED — switch to Task.parMap2, which has the same behavior.
DEPRECATED — switch to Task.parMap2, which has the same behavior.
- Deprecated
[Since version 3.0.0-RC2]
- Inherited from
- Extensions