monix.eval

Task

object Task extends TaskInstances with Serializable

Linear Supertypes
Serializable, Serializable, TaskInstances, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Task
  2. Serializable
  3. Serializable
  4. TaskInstances
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

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

    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.

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

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

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

    Constructs a lazy Task instance.

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

    Constructs a lazy Task instance that gets evaluated only once.

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

    Constructs an eager Task instance whose result is already known.

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

    Type alias representing callbacks for create tasks.

  7. class TypeClassInstances extends Evaluable[Task]

    Groups the implementation for the type-classes defined in monix.types.

    Groups the implementation for the type-classes defined in monix.types.

    Definition Classes
    TaskInstances

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object Attempt extends Serializable

  7. object EvalOnce extends Serializable

  8. object MemoizeSuspend extends Serializable

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

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

  10. final def asInstanceOf[T0]: T0

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

    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.

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

    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

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

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

  14. def clone(): AnyRef

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

    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.

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

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

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

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

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

    Transforms a Coeval into a Task.

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

    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.

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

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

  22. def finalize(): Unit

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

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

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

    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.

  25. def gather[A](in: Seq[Task[A]]): Task[List[A]]

    Nondeterministically gather results from the given sequence of tasks, returning a task that will signal a sequence of results once all tasks are finished.

    Nondeterministically gather results from the given sequence of tasks, returning a task that will signal a sequence of results once all tasks are finished.

    This function is the nondeterministic analogue of sequence and should behave identically to sequence so long as there is no interaction between the effects being gathered. However, unlike sequence, which decides on a total order of effects, the effects in a gather are unordered with respect to each other.

    Although the effects are unordered, we ensure the order of results matches the order of the input sequence. Also see gatherUnordered.

    Alias for zipList.

  26. def gatherUnordered[A](in: Seq[Task[A]]): Task[Seq[A]]

    Nondeterministically gather results from the given sequence of tasks to a sequence, without keeping the original ordering of results.

    Nondeterministically gather results from the given sequence of tasks to a sequence, without keeping the original ordering of results.

    This function is similar to gather, but neither the effects nor the results will be ordered. Useful when you don't need ordering because it can be more efficient than gather.

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

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

    Definition Classes
    AnyRef → Any
  29. final def isInstanceOf[T0]: Boolean

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

    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.

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

    Definition Classes
    AnyRef
  32. def never[A]: Task[A]

    A Task instance that upon evaluation will never complete.

  33. implicit val nondeterminism: TypeClassInstances

    Type-class instances for Task that have nondeterministic effects for Applicative.

    Type-class instances for Task that have nondeterministic effects for Applicative.

    It can be optionally imported in scope to make map2 and ap to potentially run tasks in parallel.

    Definition Classes
    TaskInstances
  34. final def notify(): Unit

    Definition Classes
    AnyRef
  35. final def notifyAll(): Unit

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

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

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

    Lifts a value into the task context.

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

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

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

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

    Given a sequence of tasks, transforms it to a task signaling a sequence, executing the tasks one by one and gathering their results in a list.

    Given a sequence of tasks, transforms it to a task signaling a sequence, executing the tasks one by one and gathering their results in a list.

    This operation will execute the tasks one by one, in order, which means that both effects and results will be ordered. See gather and gatherUnordered for unordered results or effects, and thus potential of running in paralel.

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

    Definition Classes
    AnyRef
  41. def toString(): String

    Definition Classes
    AnyRef → Any
  42. implicit val typeClassInstances: TypeClassInstances

    Type-class instances for Task.

  43. final val unit: Task[Unit]

    A Task[Unit] provided for convenience.

  44. def unsafeCreate[A](onFinish: (Scheduler, StackedCancelable, Callback[A]) ⇒ Unit): Task[A]

    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.

  45. def unsafeStartAsync[A](source: Task[A], scheduler: Scheduler, conn: StackedCancelable, cb: Callback[A]): Unit

    Unsafe utility - starts the execution of a Task with a guaranteed asynchronous boundary, by providing the needed Scheduler, StackedCancelable and Callback.

    Unsafe utility - starts the execution of a Task with a guaranteed asynchronous boundary, by providing the needed Scheduler, StackedCancelable and Callback.

    DO NOT use directly, as it is UNSAFE to use, unless you know what you're doing. Prefer Task.runAsync and Task.fork.

  46. def unsafeStartNow[A](source: Task[A], scheduler: Scheduler, conn: StackedCancelable, cb: Callback[A]): Unit

    Unsafe utility - starts the execution of a Task, by providing the needed Scheduler, StackedCancelable and Callback.

    Unsafe utility - starts the execution of a Task, by providing the needed Scheduler, StackedCancelable and Callback.

    DO NOT use directly, as it is UNSAFE to use, unless you know what you're doing. Prefer Task.runAsync.

  47. final def wait(): Unit

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

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

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

    Pairs two Task instances.

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

    Pairs three Task instances.

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

    Pairs four Task instances.

  53. 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)]

    Pairs five Task instances.

  54. 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)]

    Pairs six Task instances.

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

    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.

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

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

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

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

  58. 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]

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

  59. 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]

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

  60. 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]

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

Inherited from Serializable

Inherited from Serializable

Inherited from TaskInstances

Inherited from AnyRef

Inherited from Any

Ungrouped