Packages

object Task extends TaskPlatform with TaskInstances

Source
Task.scala
Linear Supertypes
TaskInstances, TaskInstancesLowPriority, TaskPlatform, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Task
  2. TaskInstances
  3. TaskInstancesLowPriority
  4. TaskPlatform
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Callback[-A] = (Attempt[A]) ⇒ Unit
  2. class EffectTask extends Effect[Task]
    Attributes
    protected
    Definition Classes
    TaskInstancesLowPriority
  3. implicit class JvmSyntax[A] extends AnyRef
    Definition Classes
    TaskPlatform
  4. class Ref [A] extends util.Async.Ref[Task, A]

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply[A](a: ⇒ A)(implicit S: Strategy): Task[A]

    Create a Future that will evaluate a using the given Strategy.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def async[A](register: ((Either[Throwable, A]) ⇒ Unit) ⇒ Unit)(implicit S: Strategy): 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. The callback is run using the strategy S.

  7. implicit def asyncInstance(implicit S: Strategy): Async[Task]
    Definition Classes
    TaskInstances
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def delay[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 unmemoized, this will recompute a each time it is sequenced into a larger computation. Memoize a with a lazy value before calling this function if memoization is desired.

  10. implicit val effectInstance: Effect[Task]
    Definition Classes
    TaskInstancesLowPriority
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def fail(e: Throwable): Task[Nothing]

    A Task which fails with the given Throwable.

  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fromAttempt[A](attempt: Attempt[A]): Task[A]

    Create a Task from an Attempt.

  16. def fromFuture[A](fut: ⇒ Future[A])(implicit S: Strategy, E: ExecutionContext): Task[A]

    Create a Task from a scala.concurrent.Future.

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  23. def now[A](a: A): Task[A]

    Convert a strict value to a Task.

    Convert a strict value to a Task. Also see delay.

  24. def parallelTraverse[A, B](s: Seq[A])(f: (A) ⇒ Task[B])(implicit S: Strategy): Task[Vector[B]]
  25. def ref[A](implicit S: Strategy, F: Async[Task]): Task[Ref[A]]
  26. def schedule[A](a: ⇒ A, delay: FiniteDuration)(implicit S: Strategy, scheduler: Scheduler): Task[A]

    Create a Task that will evaluate a after at least the given delay.

  27. def start[A](t: Task[A])(implicit S: Strategy): Task[Task[A]]

    Given t: Task[A], start(t) returns a Task[Task[A]].

    Given t: Task[A], start(t) returns a Task[Task[A]]. After flatMap-ing into the outer task, t will be running in the background, and the inner task is conceptually a future which can be forced at any point via flatMap.

    For example:

    for {
      f <- Task.start { expensiveTask1 }
      // at this point, `expensive1` is evaluating in background
      g <- Task.start { expensiveTask2 }
      // now both `expensiveTask2` and `expensiveTask1` are running
      result1 <- f
      // we have forced `f`, so now only `expensiveTask2` may be running
      result2 <- g
      // we have forced `g`, so now nothing is running and we have both results
    } yield (result1 + result2)
  28. def suspend[A](a: ⇒ Task[A]): Task[A]

    Produce f in the main trampolining loop, Future.step, using a fresh call stack.

    Produce f in the main trampolining loop, Future.step, using a fresh call stack. The standard trampolining primitive, useful for avoiding stack overflows.

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. def traverse[A, B](v: Seq[A])(f: (A) ⇒ Task[B]): Task[Vector[B]]
  32. def unforkedAsync[A](register: ((Attempt[A]) ⇒ Unit) ⇒ Unit): Task[A]

    Like async, but run the callback in the same thread in the same thread, rather than evaluating the callback using a Strategy.

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

Inherited from TaskInstances

Inherited from TaskInstancesLowPriority

Inherited from TaskPlatform

Inherited from AnyRef

Inherited from Any

Ungrouped