Object/Class

fs2.util

Task

Related Docs: class Task | package util

Permalink

object Task extends Instances

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

Type Members

  1. type Callback[A] = (Either[Throwable, A]) ⇒ Unit

    Permalink
  2. class Ref[A] extends AnyRef

    Permalink

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. def Try[A](a: ⇒ A): Either[Throwable, A]

    Permalink

    Utility function - evaluate a and catch and return any exceptions.

  5. def TryTask[A](a: ⇒ Task[A]): Task[A]

    Permalink
  6. def apply[A](a: ⇒ A)(implicit S: Strategy): Task[A]

    Permalink

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

  7. final def asInstanceOf[T0]: T0

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

  9. implicit def asyncInstance(implicit S: Strategy): Async[Task]

    Permalink
    Definition Classes
    Instances
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def delay[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 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.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def fail(e: Throwable): Task[Nothing]

    Permalink

    A Task which fails with the given Throwable.

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  19. implicit def monad: Catchable[Task]

    Permalink
    Definition Classes
    Instances1
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

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

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

    Permalink

    Convert a strict value to a Task.

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

  24. def ref[A](implicit S: Strategy): Task[Ref[A]]

    Permalink
  25. implicit val runInstance: Run[Task]

    Permalink
    Definition Classes
    Instances
  26. def schedule[A](a: ⇒ A, delay: FiniteDuration)(implicit S: Strategy, scheduler: Scheduler): Task[A]

    Permalink

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

    Permalink

    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]

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef → Any
  31. def unforkedAsync[A](register: ((Either[Throwable, A]) ⇒ Unit) ⇒ Unit): Task[A]

    Permalink

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

  32. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def fork[A](a: ⇒ Task[A])(implicit S: Strategy): Task[A]

    Permalink

    Don't use this.

    Don't use this. It doesn't do what you think. If you have a t: Task[A] you'd like to evaluate concurrently, use Task.start(t) flatMap { ft => ..}.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.8) use Task.start

Inherited from Instances

Inherited from Instances1

Inherited from AnyRef

Inherited from Any

Ungrouped