Object/Class

monix.eval

Task

Related Docs: class Task | package eval

Permalink

object Task extends Serializable

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Task
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class Attempt[+A] extends Task[A]

    Permalink

    The Attempt represents a strict, already evaluated result of a Task that either resulted in success, wrapped in a Now, or in an error, wrapped in a Error.

    The Attempt represents a strict, already evaluated result of a Task that either resulted in success, wrapped in a Now, or in an error, wrapped in a Error.

    It's the moral equivalent of scala.util.Try.

  2. final case class Error(ex: Throwable) extends Attempt[Nothing] with Product with Serializable

    Permalink

    Constructs an eager Task instance for a result that represents an error.

    Constructs an eager Task instance for a result that represents an error.

    Error is a Attempt task state that represents a computation that terminated in error.

  3. final case class EvalAlways[+A](f: () ⇒ A) extends Task[A] with Product with Serializable

    Permalink

    Constructs a lazy Task instance.

    Constructs a lazy Task instance.

    This type can be used for "lazy" values. In some sense it is equivalent to using a Function0 value.

  4. final class EvalOnce[+A] extends Task[A] with () ⇒ A

    Permalink

    Constructs a lazy Task instance that gets evaluated only once.

    Constructs a lazy Task instance that gets evaluated only once.

    In some sense it is equivalent to using a lazy val. When caching is not required or desired, prefer EvalAlways or Now.

  5. final case class Now[+A](value: A) extends Attempt[A] with Product with Serializable

    Permalink

    Constructs an eager Task instance whose result is already known.

    Constructs an eager Task instance whose result is already known.

    Now is a Attempt task state that represents a strict successful value.

  6. type OnFinish[+A] = (Scheduler, StackedCancelable, Callback[A]) ⇒ Unit

    Permalink

    Type alias representing callbacks for create tasks.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Attempt extends Serializable

    Permalink
  5. object EvalOnce extends Serializable

    Permalink
  6. object MemoizeSuspend extends Serializable

    Permalink
  7. def apply[A](f: ⇒ A): Task[A]

    Permalink

    Returns a new task that, when executed, will emit the result of the given function executed asynchronously.

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def both[A, B](a: Task[A], b: Task[B]): Task[(A, B)]

    Permalink

    Obtain results from both a and b, nondeterministically ordering their effects.

    Obtain results from both a and b, nondeterministically ordering their effects.

    The two tasks are both executed asynchronously. In a multi-threading environment this means that the tasks will get executed in parallel and their results synchronized.

  10. def chooseFirstOf[A, B](fa: Task[A], fb: Task[B]): Task[Either[(A, CancelableFuture[B]), (CancelableFuture[A], B)]]

    Permalink

    Creates a Task that upon execution will execute both given tasks (possibly in parallel in case the tasks are asynchronous) and will return the result of the task that manages to complete first, along with a cancelable future of the other task.

    Creates a Task that upon execution will execute both given tasks (possibly in parallel in case the tasks are asynchronous) and will return the result of the task that manages to complete first, along with a cancelable future of the other task.

    If the first task that completes

  11. def chooseFirstOfList[A](tasks: TraversableOnce[Task[A]]): Task[A]

    Permalink

    Creates a Task that upon execution will return the result of the first completed task in the given list and then cancel the rest.

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def create[A](register: (Scheduler, Callback[A]) ⇒ Cancelable): Task[A]

    Permalink

    Create a Task from an asynchronous computation, which takes the form of a function with which we can register a callback.

    Create a Task from an asynchronous computation, which takes the form of a function with which we can register a callback.

    This can be used to translate from a callback-based API to a straightforward monadic version. Note that execution of the register callback always happens asynchronously.

    register

    is a function that will be called when this Task is executed, receiving a callback as a parameter, a callback that the user is supposed to call in order to signal the desired outcome of this Task.

  14. def defer[A](task: ⇒ Task[A]): Task[A]

    Permalink

    Promote a non-strict value representing a Task to a Task of the same type.

  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def eval[A](eval: Coeval[A]): Task[A]

    Permalink

    Transforms a Coeval into a Task.

  18. def evalAlways[A](a: ⇒ A): Task[A]

    Permalink

    Promote a non-strict value to a Task, catching exceptions in the process.

    Promote a non-strict value to a Task, catching exceptions in the process.

    Note that since Task is not memoized, this will recompute the value each time the Task is executed.

  19. def evalOnce[A](a: ⇒ A): Task[A]

    Permalink

    Promote a non-strict value to a Task that is memoized on the first evaluation, the result being then available on subsequent evaluations.

  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def fork[A](fa: Task[A]): Task[A]

    Permalink

    Mirrors the given source Task, but upon execution ensure that evaluation forks into a separate (logical) thread.

  22. def fromFuture[A](f: Future[A]): Task[A]

    Permalink

    Converts the given Scala Future into a Task.

    Converts the given Scala Future into a Task.

    NOTE: if you want to defer the creation of the future, use in combination with defer.

  23. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  24. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  25. implicit val instances: Evaluable[Task] with Asynchronous[Task]

    Permalink

    Type-class instances for Task.

  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. def mapBoth[A1, A2, R](fa1: Task[A1], fa2: Task[A2])(f: (A1, A2) ⇒ R): Task[R]

    Permalink

    Apply a mapping functions to the results of two tasks, nondeterministically ordering their effects.

    Apply a mapping functions to the results of two tasks, nondeterministically ordering their effects.

    If the two tasks are synchronous, they'll get executed immediately, one after the other, with the result being available synchronously. If the two tasks are asynchronous, they'll get scheduled for execution at the same time and in a multi-threading environment they'll execute in parallel and have their results synchronized.

  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. def never[A]: Task[A]

    Permalink

    A Task instance that upon evaluation will never complete.

  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. def now[A](a: A): Task[A]

    Permalink

    Returns a Task that on execution is always successful, emitting the given strict value.

  33. def pure[A](a: A): Task[A]

    Permalink

    Lifts a value into the task context.

    Lifts a value into the task context. Alias for now.

  34. def raiseError[A](ex: Throwable): Task[A]

    Permalink

    Returns a task that on execution is always finishing in error emitting the specified exception.

  35. def sequence[A](in: Seq[Task[A]]): Task[List[A]]

    Permalink

    Gathers the results from a sequence of tasks into a single list.

    Gathers the results from a sequence of tasks into a single list. The effects are not ordered, but the results are.

    Alias for zipList.

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. val unit: Task[Unit]

    Permalink

    A Task[Unit] provided for convenience.

  39. def unsafeCreate[A](onFinish: OnFinish[A]): Task[A]

    Permalink

    Constructs a lazy Task instance whose result will be computed asynchronously.

    Constructs a lazy Task instance whose result will be computed asynchronously.

    Unsafe to use directly, only use if you know what you're doing. For building Task instances safely see create.

  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def zip2[A1, A2, R](fa1: Task[A1], fa2: Task[A2]): Task[(A1, A2)]

    Permalink

    Pairs two Task instances.

  44. def zip3[A1, A2, A3](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3]): Task[(A1, A2, A3)]

    Permalink

    Pairs three Task instances.

  45. def zip4[A1, A2, A3, A4](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3], fa4: Task[A4]): Task[(A1, A2, A3, A4)]

    Permalink

    Pairs four Task instances.

  46. def zip5[A1, A2, A3, A4, A5](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3], fa4: Task[A4], fa5: Task[A5]): Task[(A1, A2, A3, A4, A5)]

    Permalink

    Pairs five Task instances.

  47. def zip6[A1, A2, A3, A4, A5, A6](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3], fa4: Task[A4], fa5: Task[A5], fa6: Task[A6]): Task[(A1, A2, A3, A4, A5, A6)]

    Permalink

    Pairs six Task instances.

  48. def zipList[A](sources: Seq[Task[A]]): Task[List[A]]

    Permalink

    Gathers the results from a sequence of tasks into a single list.

    Gathers the results from a sequence of tasks into a single list. The effects are not ordered, but the results are.

  49. def zipWith2[A1, A2, R](fa1: Task[A1], fa2: Task[A2])(f: (A1, A2) ⇒ R): Task[R]

    Permalink

    Pairs two Task instances, creating a new instance that will apply the given mapping function to the resulting pair.

  50. def zipWith3[A1, A2, A3, R](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3])(f: (A1, A2, A3) ⇒ R): Task[R]

    Permalink

    Pairs three Task instances, applying the given mapping function to the result.

  51. def zipWith4[A1, A2, A3, A4, R](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3], fa4: Task[A4])(f: (A1, A2, A3, A4) ⇒ R): Task[R]

    Permalink

    Pairs four Task instances, applying the given mapping function to the result.

  52. def zipWith5[A1, A2, A3, A4, A5, R](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3], fa4: Task[A4], fa5: Task[A5])(f: (A1, A2, A3, A4, A5) ⇒ R): Task[R]

    Permalink

    Pairs five Task instances, applying the given mapping function to the result.

  53. def zipWith6[A1, A2, A3, A4, A5, A6, R](fa1: Task[A1], fa2: Task[A2], fa3: Task[A3], fa4: Task[A4], fa5: Task[A5], fa6: Task[A6])(f: (A1, A2, A3, A4, A5, A6) ⇒ R): Task[R]

    Permalink

    Pairs six Task instances, applying the given mapping function to the result.

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped