DeprecatedExtensions

final class DeprecatedExtensions[+A](val self: Task[A]) extends AnyVal with Extensions[A]

Deprecated operations, described as extension methods.

Deprecated operations, described as extension methods.

trait Extensions[A]
class AnyVal
trait Matchable
class Any

Value members

Deprecated and Inherited methods

@deprecated("Switch to executeWithOptions(_.enableAutoCancelableRunLoops)", "3.0.0")
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.

Deprecated
Inherited from
Extensions
@deprecated("Replaced with Coeval(task.runSyncStep)", since = "3.0.0-RC2")
def coeval(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)

Deprecated
[Since version 3.0.0-RC2]
Inherited from
Extensions
@deprecated("Please use flatMap", "3.0.0")
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
Deprecated
Inherited from
Extensions
@deprecated("Please rewrite in terms of flatMap", "3.0.0")
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 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 Task!.executeAsync", "3.0.0")

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("Replaced with start", since = "3.0.0-RC2")
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 as fork from 3.0.0-RC1

Deprecated
[Since version 3.0.0-RC2]
Inherited from
Extensions
@UnsafeBecauseImpure @deprecated("Renamed to Task.runToFuture", since = "3.0.0")
def runAsync(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.

Deprecated
[Since version 3.0.0]
Inherited from
Extensions
@UnsafeBecauseImpure @deprecated("Renamed to Task.runAsyncOpt", since = "3.0.0")
def runAsyncOpt(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.

Deprecated
[Since version 3.0.0]
Inherited from
Extensions
@UnsafeBecauseImpure @deprecated("Please use `Task.runAsync`", since = "3.0.0")
def runOnComplete(f: Try[A] => Unit)(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 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
@UnsafeBecauseImpure @deprecated("Please use `Task.runSyncStep`", since = "3.0.0")
def runSyncMaybe(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.

Deprecated
[Since version 3.0.0]
Inherited from
Extensions
@UnsafeBecauseImpure @deprecated("Please use `Task.runAsyncOpt`", since = "3.0.0")
def runSyncMaybeOpt(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.

Deprecated
[Since version 3.0.0]
Inherited from
Extensions
@deprecated("Switch to task.to[IO]", since = "3.0.0-RC3")
def toIO(eff: ConcurrentEffect[[A] =>> Task[A]]): 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]
Deprecated
[Since version 3.0.0-RC3]
Inherited from
Extensions
@deprecated("Please use `Task.redeem`", since = "3.0.0-RC2")
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 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("Please use `Task.redeemWith`", since = "3.0.0-RC2")
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 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", since = "3.0.0-RC2")
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.

Deprecated
[Since version 3.0.0-RC2]
Inherited from
Extensions
@deprecated("Use Task.parMap2", since = "3.0.0-RC2")
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.

Deprecated
[Since version 3.0.0-RC2]
Inherited from
Extensions

Concrete fields

val self: Task[A]