Packages

sealed trait Outcome[F[_], E, A] extends Product with Serializable

Represents the result of the execution of a fiber. It may terminate in one of 3 states:

  1. Succeeded(fa) The fiber completed with a value.

A commonly asked question is why this wraps a value of type F[A] rather than one of type A. This is to support monad transformers. Consider

val oc: OutcomeIO[Int] =
  for {
    fiber <- Spawn[OptionT[IO, *]].start(OptionT.none[IO, Int])
    oc <- fiber.join
  } yield oc

If the fiber succeeds then there is no value of type Int to be wrapped in Succeeded, hence Succeeded contains a value of type OptionT[IO, Int] instead.

In general you can assume that binding on the value of type F[A] contained in Succeeded does not perform further effects. In the case of IO that means that the outcome has been constructed as Outcome.Succeeded(IO.pure(result)).

2. Errored(e) The fiber exited with an error.

3. Canceled() The fiber was canceled, either externally or self-canceled via MonadCancel[F]#canceled.

Source
Outcome.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Outcome
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def canEqual(that: Any): Boolean
    Definition Classes
    Equals
  2. abstract def productArity: Int
    Definition Classes
    Product
  3. abstract def productElement(n: Int): Any
    Definition Classes
    Product

Concrete 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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def embed(onCancel: F[A])(implicit F: MonadCancel[F, E]): F[A]
  7. def embedError(implicit F: MonadCancel[F, E], ev: <:<[Throwable, E]): F[A]

    Allows the restoration to a normal development flow from an Outcome.

    Allows the restoration to a normal development flow from an Outcome.

    This can be useful for storing the state of a running computation and then waiters for that data can act and continue forward on that shared outcome. Cancelation is encoded as a CancellationException.

  8. def embedNever(implicit F: GenSpawn[F, E]): F[A]
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. def fold[B](canceled: => B, errored: (E) => B, completed: (F[A]) => B): B
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def isCanceled: Boolean
  16. def isError: Boolean
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def isSuccess: Boolean
  19. def mapK[G[_]](f: ~>[F, G]): Outcome[G, E, A]
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def productElementName(n: Int): String
    Definition Classes
    Product
  24. def productElementNames: Iterator[String]
    Definition Classes
    Product
  25. def productIterator: Iterator[Any]
    Definition Classes
    Product
  26. def productPrefix: String
    Definition Classes
    Product
  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped