Object/Class

monix.eval

Task

Related Docs: class Task | package eval

Permalink

object Task extends TaskInstances with Serializable

Builders for Task.

Linear Supertypes
Serializable, Serializable, TaskInstances, TaskInstances2, TaskInstances1, TaskInstances0, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Task
  2. Serializable
  3. Serializable
  4. TaskInstances
  5. TaskInstances2
  6. TaskInstances1
  7. TaskInstances0
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class Context(scheduler: Scheduler, connection: StackedCancelable, frameRef: FrameIndexRef, options: Options) extends Product with Serializable

    Permalink

    The Context under which Task is supposed to be executed.

    The Context under which Task is supposed to be executed.

    This definition is of interest only when creating tasks with Task.unsafeCreate, which exposes internals and is considered unsafe to use.

    scheduler

    is the Scheduler in charge of evaluation on runAsync.

    connection

    is the StackedCancelable that handles the cancellation on runAsync

    frameRef

    is a thread-local counter that keeps track of the current frame index of the run-loop. The run-loop is supposed to force an asynchronous boundary upon reaching a certain threshold, when the task is evaluated with monix.execution.ExecutionModel.BatchedExecution. And this frameIndexRef should be reset whenever a real asynchronous boundary happens. See the description of FrameIndexRef.

    options

    is a set of options for customizing the task's behavior upon evaluation.

  2. type FrameIndex = Int

    Permalink

    A run-loop frame index is a number representing the current run-loop cycle, being incremented whenever a flatMap evaluation happens.

    A run-loop frame index is a number representing the current run-loop cycle, being incremented whenever a flatMap evaluation happens.

    It gets used for automatically forcing asynchronous boundaries, according to the ExecutionModel injected by the Scheduler when the task gets evaluated with runAsync.

    See also

    FrameIndexRef

  3. sealed abstract class FrameIndexRef extends AnyRef

    Permalink

    A reference that boxes a FrameIndex possibly using a thread-local.

    A reference that boxes a FrameIndex possibly using a thread-local.

    This definition is of interest only when creating tasks with Task.unsafeCreate, which exposes internals and is considered unsafe to use.

    In case the Task is executed with BatchedExecution, this class boxes a FrameIndex in order to transport it over light async boundaries, possibly using a ThreadLocal, since this index is not supposed to survive when threads get forked.

    The FrameIndex is a counter that increments whenever a flatMap operation is evaluated. And with BatchedExecution, whenever that counter exceeds the specified threshold, an asynchronous boundary is automatically inserted. However this capability doesn't blend well with light asynchronous boundaries, for example Async tasks that never fork logical threads or TrampolinedRunnable instances executed by capable schedulers. This is why FrameIndexRef is part of the Context of execution for Task, available for asynchronous tasks that get created with Task.unsafeCreate.

    Note that in case the execution model is not BatchedExecution then this reference is just a dummy, since there's no point in keeping a counter around, plus setting and fetching from a ThreadLocal can be quite expensive.

  4. type OnFinish[+A] = (Context, Callback[A]) ⇒ Unit

    Permalink

    Type alias representing callbacks for asynchronous tasks.

  5. final case class Options(autoCancelableRunLoops: Boolean) extends Product with Serializable

    Permalink

    Set of options for customizing the task's behavior.

    Set of options for customizing the task's behavior.

    autoCancelableRunLoops

    should be set to true in case you want flatMap driven loops to be auto-cancelable. Defaults to false.

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 Context extends Serializable

    Permalink
  5. object FrameIndexRef

    Permalink
  6. 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.

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

    f

    is the callback to execute asynchronously

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def async[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.

    Alias for Task.create.

    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.

  9. implicit def catsAsync(implicit as: ApplicativeStrategy[Task]): CatsAsyncInstances[Task]

    Permalink

    Type class instances of Task for Cats.

    Type class instances of Task for Cats.

    In order to determine the returned instance to do parallel processing in cats.Applicative then import Task.nondeterminism in scope:

    import monix.eval.Task.nondeterminism
    
    // The Task's Applicative will now do parallel processing
    // if the given tasks are forking (logical) threads
    // (e.g. will use `Task.mapBoth`)
    val ap = implicitly[cats.Applicative[Task]]
    ap.map2(task1, task2) { (a, b) => a + b }
    
    // Or using the "applicative builder" syntax:
    import cats.syntax.all._
    (task1 |@| task2).map { (a, b) => a + b }
    as

    is the applicative strategy to use when calling map2, ap or product, specifying whether the returned instance should do sequential or parallel processing.

    Definition Classes
    TaskInstances
    Annotations
    @inline()
  10. implicit def catsEffect(implicit as: ApplicativeStrategy[Task], s: Scheduler): CatsEffectInstances[Task]

    Permalink

    Type class instances of Task for cats.effect.Effect.

    Type class instances of Task for cats.effect.Effect.

    In order to determine the returned instance to do parallel processing in cats.Applicative then import Task.nondeterminism in scope:

    import monix.eval.Task.nondeterminism
    
    // The Task's Applicative will now do parallel processing
    // if the given tasks are forking (logical) threads
    // (e.g. will use `Task.mapBoth`)
    val ap = implicitly[cats.Applicative[Task]]
    ap.map2(task1, task2) { (a, b) => a + b }
    
    // Or using the "applicative builder" syntax:
    import cats.syntax.all._
    (task1 |@| task2).map { (a, b) => a + b }
    as

    is the applicative strategy to use when calling map2, ap or product, specifying whether the returned instance should do sequential or parallel processing.

    s

    is the Scheduler to use when executing Effect#runAsync

    Definition Classes
    TaskInstances2
    Annotations
    @inline()
  11. 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

  12. 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.

  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def coeval[A](a: Coeval[A]): Task[A]

    Permalink

    Transforms a Coeval into a Task.

  15. 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.

    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. val defaultOptions: Options

    Permalink

    Default Options to use for Task evaluation, thus:

    Default Options to use for Task evaluation, thus:

    • autoCancelableRunLoops is false by default

    On top of the JVM the default can be overridden by setting the following system properties:

    • monix.environment.autoCancelableRunLoops (true, yes or 1 for enabling)
    See also

    Task.Options

  17. def defer[A](fa: ⇒ Task[A]): Task[A]

    Permalink

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

  18. def deferAction[A](f: (Scheduler) ⇒ Task[A]): Task[A]

    Permalink

    Defers the creation of a Task by using the provided function, which has the ability to inject a needed Scheduler.

    Defers the creation of a Task by using the provided function, which has the ability to inject a needed Scheduler.

    Example:

    def measureLatency[A](source: Task[A]): Task[(A, Long)] =
      Task.deferAction { implicit s =>
        // We have our Scheduler, which can inject time, we
        // can use it for side-effectful operations
        val start = s.currentTimeMillis()
    
        source.map { a =>
          val finish = s.currentTimeMillis()
          (a, finish - start)
        }
      }
    f

    is the function that's going to be called when the resulting Task gets evaluated

  19. def deferFuture[A](fa: ⇒ Future[A]): Task[A]

    Permalink

    Promote a non-strict Scala Future to a Task of the same type.

    Promote a non-strict Scala Future to a Task of the same type.

    The equivalent of doing:

    Task.defer(Task.fromFuture(fa))
  20. def deferFutureAction[A](f: (Scheduler) ⇒ Future[A]): Task[A]

    Permalink

    Wraps calls that generate Future results into Task, provided a callback with an injected Scheduler to act as the necessary ExecutionContext.

    Wraps calls that generate Future results into Task, provided a callback with an injected Scheduler to act as the necessary ExecutionContext.

    This builder helps with wrapping Future-enabled APIs that need an implicit ExecutionContext to work. Consider this example:

    import scala.concurrent.{ExecutionContext, Future}
    
    def sumFuture(list: Seq[Int])(implicit ec: ExecutionContext): Future[Int] =
      Future(list.sum)

    We'd like to wrap this function into one that returns a lazy Task that evaluates this sum every time it is called, because that's how tasks work best. However in order to invoke this function an ExecutionContext is needed:

    def sumTask(list: Seq[Int])(implicit ec: ExecutionContext): Task[Int] =
      Task.deferFuture(sumFuture(list))

    But this is not only superfluous, but against the best practices of using Task. The difference is that Task takes a Scheduler (inheriting from ExecutionContext) only when runAsync happens. But with deferFutureAction we get to have an injected Scheduler in the passed callback:

    def sumTask(list: Seq[Int]): Task[Int] =
      Task.deferFutureAction { implicit scheduler =>
        sumFuture(list)
      }
    f

    is the function that's going to be executed when the task gets evaluated, generating the wrapped Future

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

    Permalink

    Alias for eval.

  22. implicit def determinism: ApplicativeStrategy[Task]

    Permalink

    An ApplicativeStrategy instance that will determine the generated type class instances for Task to do sequential processing in their applicative (and thus to order both results and effects).

    An ApplicativeStrategy instance that will determine the generated type class instances for Task to do sequential processing in their applicative (and thus to order both results and effects).

    This is the default strategy that Task uses.

    Definition Classes
    TaskInstances1
    Annotations
    @inline()
    See also

    Task.nondeterminism for picking a strategy for applicative that does unordered effects and thus capable of parallelism

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  25. def eval[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.

  26. 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.

  27. def finalize(): Unit

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

    Permalink

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

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

    The given Scheduler will be used for execution of the Task, effectively overriding the Scheduler that's passed in runAsync. Thus you can execute a whole Task on a separate thread-pool, useful for example in case of doing I/O.

    fa

    is the task that will get executed asynchronously

    scheduler

    is the scheduler to use for execution

  29. 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.

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

    The Scheduler used will be the one that is used to start the run-loop in runAsync.

    fa

    is the task that will get executed asynchronously

  30. def fromEval[A](a: cats.Eval[A]): Task[A]

    Permalink

    Builds a Task instance out of a cats.Eval.

  31. 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.

  32. def fromIO[A](a: IO[A]): Task[A]

    Permalink

    Builds a Task instance out of a cats.effect.IO.

  33. def fromTry[A](a: Try[A]): Task[A]

    Permalink

    Builds a Task instance out of a Scala Try.

  34. def gather[A, M[X] <: TraversableOnce[X]](in: M[Task[A]])(implicit cbf: CanBuildFrom[M[Task[A]], A, M[A]]): Task[M[A]]

    Permalink

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

    Nondeterministically gather results from the given collection of tasks, returning a task that will signal the same type of collection 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 for the more efficient alternative.

  35. def gatherUnordered[A](in: TraversableOnce[Task[A]]): Task[List[A]]

    Permalink

    Nondeterministically gather results from the given collection of tasks, without keeping the original ordering of results.

    Nondeterministically gather results from the given collection of tasks, without keeping the original ordering of results.

    If the tasks in the list are set to execute asynchronously, forking logical threads, then the tasks will execute in parallel.

    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 has non-blocking behavior (but not wait-free)
    • it can be more efficient (compared with gather), but not necessarily (if you care about performance, then test)
    in

    is a list of tasks to execute

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

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

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

    Permalink
    Definition Classes
    Any
  39. 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 one after the other, with the result being available asynchronously. 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.

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

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

    Permalink

    A Task instance that upon evaluation will never complete.

  42. implicit def nondeterminism: ApplicativeStrategy[Task]

    Permalink

    An ApplicativeStrategy instance that, when imported in scope, will determine the generated type class instances for Task to do parallel processing in their applicative.

    An ApplicativeStrategy instance that, when imported in scope, will determine the generated type class instances for Task to do parallel processing in their applicative.

    Importing this in scope overrides the default Task.determinism strategy.

    import monix.eval.Task.nondeterminism
    
    // The Task's Applicative will now do parallel processing
    // if the given tasks are forking (logical) threads
    // (e.g. will use `Task.mapBoth`)
    val ap = implicitly[cats.Applicative[Task]]
    ap.map2(task1, task2) { (a, b) => a + b }
    
    // Or using the "applicative builder" syntax:
    import cats.syntax.all._
    (task1 |@| task2).map { (a, b) => a + b }
    Definition Classes
    TaskInstances0
    Annotations
    @inline()
  43. final def notify(): Unit

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

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

    Permalink

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

  46. 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.

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

    Permalink

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

  48. def sequence[A, M[X] <: TraversableOnce[X]](in: M[Task[A]])(implicit cbf: CanBuildFrom[M[Task[A]], A, M[A]]): Task[M[A]]

    Permalink

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

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

    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 parallel.

    It's a simple version of traverse.

  49. def suspend[A](fa: ⇒ Task[A]): Task[A]

    Permalink

    Alias for defer.

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

    Permalink
    Definition Classes
    AnyRef
  51. def tailRecM[A, B](a: A)(f: (A) ⇒ Task[Either[A, B]]): Task[B]

    Permalink

    Keeps calling f until it returns a Right result.

    Keeps calling f until it returns a Right result.

    Based on Phil Freeman's Stack Safety for Free.

  52. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  53. def traverse[A, B, M[X] <: TraversableOnce[X]](in: M[A])(f: (A) ⇒ Task[B])(implicit cbf: CanBuildFrom[M[A], B, M[B]]): Task[M[B]]

    Permalink

    Given a TraversableOnce[A] and a function A => Task[B], sequentially apply the function to each element of the collection and gather their results in the same collection.

    Given a TraversableOnce[A] and a function A => Task[B], sequentially apply the function to each element of the collection and gather their results in the same collection.

    It's a generalized version of sequence.

  54. final val unit: Task[Unit]

    Permalink

    A Task[Unit] provided for convenience.

  55. 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.

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

    Rules of usage:

    • the received StackedCancelable can be used to store cancelable references that will be executed upon cancel; every push must happen at the beginning, before any execution happens and pop must happen afterwards when the processing is finished, before signaling the result
    • the received FrameRef indicates the current frame index and must be reset on real asynchronous boundaries (which avoids doing extra async boundaries in batched execution mode)
    • before execution, an asynchronous boundary is recommended, to avoid stack overflow errors, but can happen using the scheduler's facilities for trampolined execution
    • on signaling the result (onSuccess, onError), another async boundary is necessary, but can also happen with the scheduler's facilities for trampolined execution (e.g. asyncOnSuccess and asyncOnError)

    **WARNING:** note that not only is this builder unsafe, but also unstable, as the OnFinish callback type is exposing volatile internal implementation details. This builder is meant to create optimized asynchronous tasks, but for normal usage prefer Task.create.

  56. def unsafeStartAsync[A](source: Task[A], context: Context, cb: Callback[A]): Unit

    Permalink

    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.

  57. def unsafeStartNow[A](source: Task[A], context: Context, cb: Callback[A]): Unit

    Permalink

    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.

  58. def unsafeStartTrampolined[A](source: Task[A], context: Context, cb: Callback[A]): Unit

    Permalink

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

    Unsafe utility - starts the execution of a Task with a guaranteed trampolined 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.

  59. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. def wander[A, B, M[X] <: TraversableOnce[X]](in: M[A])(f: (A) ⇒ Task[B])(implicit cbf: CanBuildFrom[M[A], B, M[B]]): Task[M[B]]

    Permalink

    Given a TraversableOnce[A] and a function A => Task[B], nondeterministically apply the function to each element of the collection and return a task that will signal a collection of the results once all tasks are finished.

    Given a TraversableOnce[A] and a function A => Task[B], nondeterministically apply the function to each element of the collection and return a task that will signal a collection of the results once all tasks are finished.

    This function is the nondeterministic analogue of traverse and should behave identically to traverse so long as there is no interaction between the effects being gathered. However, unlike traverse, which decides on a total order of effects, the effects in a wander 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 wanderUnordered for the more efficient alternative.

    It's a generalized version of gather.

  63. def wanderUnordered[A, B, M[X] <: TraversableOnce[X]](in: M[A])(f: (A) ⇒ Task[B]): Task[List[B]]

    Permalink

    Given a TraversableOnce[A] and a function A => Task[B], nondeterministically apply the function to each element of the collection without keeping the original ordering of the results.

    Given a TraversableOnce[A] and a function A => Task[B], nondeterministically apply the function to each element of the collection without keeping the original ordering of the results.

    This function is similar to wander, but neither the effects nor the results will be ordered. Useful when you don't need ordering because:

    • it has non-blocking behavior (but not wait-free)
    • it can be more efficient (compared with wander), but not necessarily (if you care about performance, then test)

    It's a generalized version of gatherUnordered.

  64. def zip2[A1, A2, R](fa1: Task[A1], fa2: Task[A2]): Task[(A1, A2)]

    Permalink

    Pairs two Task instances.

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

    Permalink

    Pairs three Task instances.

  66. 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.

  67. 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.

  68. 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.

  69. def zipList[A](sources: 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.

  70. def zipMap2[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.

  71. def zipMap3[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.

  72. def zipMap4[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.

  73. def zipMap5[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.

  74. def zipMap6[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 TaskInstances

Inherited from TaskInstances2

Inherited from TaskInstances1

Inherited from TaskInstances0

Inherited from AnyRef

Inherited from Any

Ungrouped