Packages

object Fiber extends FiberPlatformSpecific

Linear Supertypes
FiberPlatformSpecific, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Fiber
  2. FiberPlatformSpecific
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class Descriptor(id: Id, status: Status, interruptors: Set[Id], interruptStatus: InterruptStatus, children: UIO[Iterable[Runtime[Any, Any]]], executor: Executor) extends Product with Serializable

    A record containing information about a Fiber.

    A record containing information about a Fiber.

    id

    The fiber's unique identifier

    interruptors

    The set of fibers attempting to interrupt the fiber or its ancestors.

    children

    The fiber's forked children.

    executor

    The zio.internal.Executor executing this fiber

  2. final case class Dump(fiberId: Id, fiberName: Option[String], status: Status, children: Iterable[Dump], trace: Option[ZTrace]) extends Serializable with Product
  3. final case class Id(startTimeMillis: Long, seqNumber: Long) extends Serializable with Product

    The identity of a Fiber, described by the time it began life, and a monotonically increasing sequence number generated from an atomic counter.

  4. sealed trait Runtime[+E, +A] extends Fiber[E, A]

    A runtime fiber that is executing an effect.

    A runtime fiber that is executing an effect. Runtime fibers ave an identity and a trace.

  5. sealed trait Status extends Serializable with Product
  6. sealed trait Synthetic[+E, +A] extends Fiber[E, A]

    A synthetic fiber that is created from a pure value or that combines existing fibers.

Value Members

  1. def awaitAll(fs: Iterable[Fiber[Any, Any]]): UIO[Unit]

    Awaits on all fibers to be completed, successfully or not.

    Awaits on all fibers to be completed, successfully or not.

    fs

    Iterable of fibers to be awaited

    returns

    UIO[Unit]

  2. def collectAll[E, A](fibers: Iterable[Fiber[E, A]]): Synthetic[E, List[A]]

    Collects all fibers into a single fiber producing an in-order list of the results.

  3. def done[E, A](exit: ⇒ Exit[E, A]): Synthetic[E, A]

    A fiber that is done with the specified zio.Exit value.

    A fiber that is done with the specified zio.Exit value.

    E

    error type

    A

    type of the fiber

    exit

    zio.Exit value

    returns

    Fiber[E, A]

  4. def dump(fibers: Runtime[_, _]*): UIO[Iterable[Dump]]

    Collects a complete dump of the specified fibers and all children of the fibers.

  5. val dumpAll: UIO[Iterable[Dump]]

    Collects a complete dump of all fibers.

    Collects a complete dump of all fibers. This could potentially be quite large.

    TODO: Switch to "streaming lazy" version.

  6. def dumpStr(fibers: Runtime[_, _]*): UIO[String]

    Collects a complete dump of the specified fibers and all children of the fibers and renders it as a string.

  7. def fail[E](e: E): Synthetic[E, Nothing]

    A fiber that has already failed with the specified value.

    A fiber that has already failed with the specified value.

    E

    error type

    e

    failure value

    returns

    Fiber[E, Nothing] failed fiber

  8. val fiberName: FiberRef[Option[String]]

    A FiberRef that stores the name of the fiber, which defaults to None.

  9. def fromCompletionStage[A](thunk: ⇒ CompletionStage[A]): Fiber[Throwable, A]
    Definition Classes
    FiberPlatformSpecific
  10. def fromEffect[E, A](io: IO[E, A]): UIO[Synthetic[E, A]]

    Lifts an zio.IO into a Fiber.

    Lifts an zio.IO into a Fiber.

    E

    error type

    A

    type of the fiber

    io

    IO[E, A] to turn into a Fiber

    returns

    UIO[Fiber[E, A]]

  11. def fromFuture[A](thunk: ⇒ Future[A]): Synthetic[Throwable, A]

    Returns a Fiber that is backed by the specified Future.

    Returns a Fiber that is backed by the specified Future.

    A

    type of the Fiber

    thunk

    Future[A] backing the Fiber

    returns

    Fiber[Throwable, A]

  12. def fromFutureJava[A](thunk: ⇒ Future[A]): Fiber[Throwable, A]

    WARNING: this uses the blocking Future#get, consider using fromCompletionStage

    WARNING: this uses the blocking Future#get, consider using fromCompletionStage

    Definition Classes
    FiberPlatformSpecific
  13. def halt[E](cause: Cause[E]): Synthetic[E, Nothing]

    Creates a Fiber that is halted with the specified cause.

  14. def interruptAll(fs: Iterable[Fiber[Any, Any]]): UIO[Unit]

    Interrupts all fibers, awaiting their interruption.

    Interrupts all fibers, awaiting their interruption.

    fs

    Iterable of fibers to be interrupted

    returns

    UIO[Unit]

  15. def interruptAllAs(fiberId: Id)(fs: Iterable[Fiber[Any, Any]]): UIO[Unit]

    Interrupts all fibers as by the specified fiber, awaiting their interruption.

    Interrupts all fibers as by the specified fiber, awaiting their interruption.

    fiberId

    The identity of the fiber to interrupt as.

    fs

    Iterable of fibers to be interrupted

    returns

    UIO[Unit]

  16. def interruptAs(id: Id): Synthetic[Nothing, Nothing]

    A fiber that is already interrupted.

    A fiber that is already interrupted.

    returns

    Fiber[Nothing, Nothing] interrupted fiber

  17. def joinAll[E](fs: Iterable[Fiber[E, Any]]): IO[E, Unit]

    Joins all fibers, awaiting their _successful_ completion.

    Joins all fibers, awaiting their _successful_ completion. Attempting to join a fiber that has errored will result in a catchable error, _if_ that error does not result from interruption.

    fs

    Iterable of fibers to be joined

    returns

    UIO[Unit]

  18. val never: Synthetic[Nothing, Nothing]

    A fiber that never fails or succeeds.

  19. def putDumpStr(label: String, fibers: Runtime[_, _]*): URIO[Console, Unit]

    Collects a complete dump of the specified fibers and all children of the fibers and renders it to the console.

  20. val roots: UIO[Set[Fiber[Any, Any]]]

    The root fibers.

  21. def succeed[A](a: A): Synthetic[Nothing, A]

    Returns a fiber that has already succeeded with the specified value.

    Returns a fiber that has already succeeded with the specified value.

    A

    type of the fiber

    a

    success value

    returns

    Fiber[E, A] succeeded fiber

  22. val unit: Synthetic[Nothing, Unit]

    A fiber that has already succeeded with unit.

  23. def unsafeCurrentFiber(): Option[Fiber[Any, Any]]

    Retrieves the fiber currently executing on this thread, if any.

    Retrieves the fiber currently executing on this thread, if any. This will always be None unless called from within an executing effect.

  24. object Id extends Serializable
  25. object Status extends Serializable