Object/Class

fs2

Task

Related Docs: class Task | package fs2

Permalink

object Task extends TaskPlatform with Instances

Source
Task.scala
Linear Supertypes
Instances, Instances1, TaskPlatform, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Task
  2. Instances
  3. Instances1
  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

    Permalink
  2. class EffectTask extends Effect[Task]

    Permalink
    Attributes
    protected
    Definition Classes
    Instances1
  3. implicit class JvmSyntax[A] extends AnyRef

    Permalink
    Definition Classes
    TaskPlatform
  4. class Ref[A] extends util.Async.Ref[Task, A]

    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 apply[A](a: ⇒ A)(implicit S: Strategy): Task[A]

    Permalink

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

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. 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.

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

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

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

  10. implicit val effectInstance: Effect[Task]

    Permalink
    Definition Classes
    Instances1
  11. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink

    A Task which fails with the given Throwable.

  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def fromFuture[A](fut: ⇒ Future[A])(implicit S: Strategy, E: ExecutionContext): Task[A]

    Permalink

    Create a Task from a scala.concurrent.Future.

  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. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  22. 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.

  23. def parallelTraverse[A, B](s: Seq[A])(f: (A) ⇒ Task[B])(implicit S: Strategy): Task[Vector[B]]

    Permalink
  24. def ref[A](implicit S: Strategy, F: Async[Task]): Task[Ref[A]]

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  30. def traverse[A, B](v: Seq[A])(f: (A) ⇒ Task[B]): Task[Vector[B]]

    Permalink
  31. def unforkedAsync[A](register: ((Attempt[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( ... )

Inherited from Instances

Inherited from Instances1

Inherited from TaskPlatform

Inherited from AnyRef

Inherited from Any

Ungrouped