object Fiber extends FiberPlatformSpecific
- Alphabetic
- By Inheritance
- Fiber
- FiberPlatformSpecific
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
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
- final case class Dump(fiberId: Id, fiberName: Option[String], status: Status, children: Iterable[Dump], trace: Option[ZTrace]) extends Serializable with Product
-
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.
-
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.
- sealed trait Status extends Serializable with Product
-
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
-
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]
-
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.
-
def
done[E, A](exit: ⇒ Exit[E, A]): Synthetic[E, A]
A fiber that is done with the specified zio.Exit value.
-
def
dump(fibers: Runtime[_, _]*): UIO[Iterable[Dump]]
Collects a complete dump of the specified fibers and all children of the fibers.
-
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.
-
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.
-
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
-
val
fiberName: FiberRef[Option[String]]
A
FiberRef
that stores the name of the fiber, which defaults toNone
. -
def
fromCompletionStage[A](thunk: ⇒ CompletionStage[A]): Fiber[Throwable, A]
- Definition Classes
- FiberPlatformSpecific
-
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 aFiber
- returns
UIO[Fiber[E, A]]
-
def
fromFuture[A](thunk: ⇒ Future[A]): Synthetic[Throwable, A]
Returns a
Fiber
that is backed by the specifiedFuture
.Returns a
Fiber
that is backed by the specifiedFuture
.- A
type of the
Fiber
- thunk
Future[A]
backing theFiber
- returns
Fiber[Throwable, A]
-
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
-
def
halt[E](cause: Cause[E]): Synthetic[E, Nothing]
Creates a
Fiber
that is halted with the specified cause. -
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]
-
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]
-
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
-
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]
-
val
never: Synthetic[Nothing, Nothing]
A fiber that never fails or succeeds.
-
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.
-
val
roots: UIO[Set[Fiber[Any, Any]]]
The root fibers.
-
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
-
val
unit: Synthetic[Nothing, Unit]
A fiber that has already succeeded with unit.
-
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. - object Id extends Serializable
- object Status extends Serializable