FiberRuntime

final class FiberRuntime[E, A](fiberId: Runtime, fiberRefs0: FiberRefs, runtimeFlags0: RuntimeFlags) extends Internal[E, A]
Companion:
object
trait Runnable
class Internal[E, A]
class Runtime[E, A]
class Fiber[E, A]
class Object
trait Matchable
class Any

Type members

Inherited classlikes

trait UnsafeAPI
Inherited from:
Runtime

Types

type Erased = ZIO[Any, Any, Any]

Value members

Concrete methods

def ask[A](f: (FiberRuntime[_, _], Status) => A)(implicit trace: Trace): UIO[A]

Returns an effect that will contain information computed from the fiber state and status while running on the fiber.

Returns an effect that will contain information computed from the fiber state and status while running on the fiber.

This allows the outside world to interact safely with mutable fiber state without locks or immutable data.

def await(implicit trace: Trace): UIO[Exit[E, A]]

Awaits the fiber, which suspends the awaiting fiber until the result of the fiber has been determined.

Awaits the fiber, which suspends the awaiting fiber until the result of the fiber has been determined.

Returns:

UIO[Exit[E, A]]

def children(implicit trace: Trace): UIO[Chunk[FiberRuntime[_, _]]]

Retrieves the immediate children of the fiber.

Retrieves the immediate children of the fiber.

def fiberRefs(implicit trace: Trace): UIO[FiberRefs]
def id: Runtime

The identity of the fiber.

The identity of the fiber.

def inheritAll(implicit trace: Trace): UIO[Unit]

Inherits values from all FiberRef instances into current fiber. This will resume immediately.

Inherits values from all FiberRef instances into current fiber. This will resume immediately.

Returns:

UIO[Unit]

def interruptAsFork(fiberId: FiberId)(implicit trace: Trace): UIO[Unit]

In the background, interrupts the fiber as if interrupted from the specified fiber. If the fiber has already exited, the returned effect will resume immediately. Otherwise, the effect will resume when the fiber exits.

In the background, interrupts the fiber as if interrupted from the specified fiber. If the fiber has already exited, the returned effect will resume immediately. Otherwise, the effect will resume when the fiber exits.

Returns:

UIO[Exit, E, A]]

The location the fiber was forked from.

The location the fiber was forked from.

def poll(implicit trace: Trace): UIO[Option[Exit[E, A]]]

Tentatively observes the fiber, but returns immediately if it is not already done.

Tentatively observes the fiber, but returns immediately if it is not already done.

Returns:

UIO[Option[Exit, E, A]]]

override def run(): Unit
Definition Classes
override def run(depth: Int): Unit
Definition Classes
FiberRunnable
def runtimeFlags(implicit trace: Trace): UIO[RuntimeFlags]
def status(implicit trace: Trace): UIO[Status]

The status of the fiber.

The status of the fiber.

def trace(implicit trace: Trace): UIO[StackTrace]

The trace of the fiber.

The trace of the fiber.

Inherited methods

final def *>[E1 >: E, B](that: Fiber[E1, B]): Synthetic[E1, B]

Same as zip but discards the output of the left hand side.

Same as zip but discards the output of the left hand side.

Type parameters:
B

type of the fiber

E1

error type

Value parameters:
that

fiber to be zipped

Returns:

Fiber[E1, B] combined fiber

Inherited from:
Fiber
final def <*[E1 >: E, B](that: Fiber[E1, B]): Synthetic[E1, A]

Same as zip but discards the output of the right hand side.

Same as zip but discards the output of the right hand side.

Type parameters:
B

type of the fiber

E1

error type

Value parameters:
that

fiber to be zipped

Returns:

Fiber[E1, A] combined fiber

Inherited from:
Fiber
final def <*>[E1 >: E, B](that: => Fiber[E1, B])(implicit zippable: Zippable[A, B]): Synthetic[E1, Out]

Zips this fiber and the specified fiber together, producing a tuple of their output.

Zips this fiber and the specified fiber together, producing a tuple of their output.

Type parameters:
B

type of that fiber

E1

error type

Value parameters:
that

fiber to be zipped

Returns:

Fiber[E1, (A, B)] combined fiber

Inherited from:
Fiber
final def <+>[E1 >: E, B](that: => Fiber[E1, B])(implicit ev: CanFail[E]): Synthetic[E1, Either[A, B]]

A symbolic alias for orElseEither.

A symbolic alias for orElseEither.

Inherited from:
Fiber
def <>[E1, A1 >: A](that: => Fiber[E1, A1])(implicit ev: CanFail[E]): Synthetic[E1, A1]

A symbolic alias for orElse.

A symbolic alias for orElse.

Inherited from:
Fiber
final def as[B](b: => B): Synthetic[E, B]

Maps the output of this fiber to the specified constant.

Maps the output of this fiber to the specified constant.

Type parameters:
B

type of the fiber

Value parameters:
b

constant

Returns:

Fiber[E, B] fiber mapped to constant

Inherited from:
Fiber
final def dump(implicit trace: Trace): UIO[Dump]

Generates a fiber dump.

Generates a fiber dump.

Inherited from:
Runtime
final def fold[Z](runtime: Runtime[E, A] => Z, synthetic: Synthetic[E, A] => Z): Z

Folds over the runtime or synthetic fiber.

Folds over the runtime or synthetic fiber.

Inherited from:
Fiber
final def interrupt(implicit trace: Trace): UIO[Exit[E, A]]

Interrupts the fiber from whichever fiber is calling this method. If the fiber has already exited, the returned effect will resume immediately. Otherwise, the effect will resume when the fiber exits.

Interrupts the fiber from whichever fiber is calling this method. If the fiber has already exited, the returned effect will resume immediately. Otherwise, the effect will resume when the fiber exits.

Returns:

UIO[Exit, E, A]]

Inherited from:
Fiber
final def interruptAs(fiberId: FiberId)(implicit trace: Trace): UIO[Exit[E, A]]

Interrupts the fiber as if interrupted from the specified fiber. If the fiber has already exited, the returned effect will resume immediately. Otherwise, the effect will resume when the fiber exits.

Interrupts the fiber as if interrupted from the specified fiber. If the fiber has already exited, the returned effect will resume immediately. Otherwise, the effect will resume when the fiber exits.

Returns:

UIO[Exit, E, A]]

Inherited from:
Fiber
final def interruptFork(implicit trace: Trace): UIO[Unit]

Interrupts the fiber from whichever fiber is calling this method. The interruption will happen in a separate daemon fiber, and the returned effect will always resume immediately without waiting.

Interrupts the fiber from whichever fiber is calling this method. The interruption will happen in a separate daemon fiber, and the returned effect will always resume immediately without waiting.

Returns:

UIO[Unit]

Inherited from:
Fiber
final def join(implicit trace: Trace): IO[E, A]

Joins the fiber, which suspends the joining fiber until the result of the fiber has been determined. Attempting to join a fiber that has erred will result in a catchable error. Joining an interrupted fiber will result in an "inner interruption" of this fiber, unlike interruption triggered by another fiber, "inner interruption" can be caught and recovered.

Joins the fiber, which suspends the joining fiber until the result of the fiber has been determined. Attempting to join a fiber that has erred will result in a catchable error. Joining an interrupted fiber will result in an "inner interruption" of this fiber, unlike interruption triggered by another fiber, "inner interruption" can be caught and recovered.

Returns:

IO[E, A]

Inherited from:
Fiber
final def map[B](f: A => B): Synthetic[E, B]

Maps over the value the Fiber computes.

Maps over the value the Fiber computes.

Type parameters:
B

result type of f

Value parameters:
f

mapping function

Returns:

Fiber[E, B] mapped fiber

Inherited from:
Fiber
final def mapFiber[E1 >: E, B](f: A => Fiber[E1, B])(implicit trace: Trace): UIO[Fiber[E1, B]]

Passes the success of this fiber to the specified callback, and continues with the fiber that it returns.

Passes the success of this fiber to the specified callback, and continues with the fiber that it returns.

Type parameters:
B

The success value.

Value parameters:
f

The callback.

Returns:

Fiber[E, B] The continued fiber.

Inherited from:
Fiber
final def mapZIO[E1 >: E, B](f: A => IO[E1, B]): Synthetic[E1, B]

Effectually maps over the value the fiber computes.

Effectually maps over the value the fiber computes.

Inherited from:
Fiber
def orElse[E1, A1 >: A](that: => Fiber[E1, A1])(implicit ev: CanFail[E]): Synthetic[E1, A1]

Returns a fiber that prefers this fiber, but falls back to the that one when this one fails. Interrupting the returned fiber will interrupt both fibers, sequentially, from left to right.

Returns a fiber that prefers this fiber, but falls back to the that one when this one fails. Interrupting the returned fiber will interrupt both fibers, sequentially, from left to right.

Type parameters:
A1

type of the other fiber

E1

error type

Value parameters:
that

fiber to fall back to

Returns:

Fiber[E1, A1]

Inherited from:
Fiber
final def orElseEither[E1, B](that: => Fiber[E1, B]): Synthetic[E1, Either[A, B]]

Returns a fiber that prefers this fiber, but falls back to the that one when this one fails. Interrupting the returned fiber will interrupt both fibers, sequentially, from left to right.

Returns a fiber that prefers this fiber, but falls back to the that one when this one fails. Interrupting the returned fiber will interrupt both fibers, sequentially, from left to right.

Type parameters:
B

type of the other fiber

E1

error type

Value parameters:
that

fiber to fall back to

Returns:

Fiber[E1, B]

Inherited from:
Fiber
final def scoped(implicit trace: Trace): ZIO[Scope, Nothing, Fiber[E, A]]

Converts this fiber into a scoped zio.ZIO. The fiber is interrupted when the scope is closed.

Converts this fiber into a scoped zio.ZIO. The fiber is interrupted when the scope is closed.

Inherited from:
Fiber
final def toFuture(implicit ev: IsSubtypeOfError[E, Throwable], trace: Trace): UIO[CancelableFuture[A]]

Converts this fiber into a scala.concurrent.Future.

Converts this fiber into a scala.concurrent.Future.

Value parameters:
ev

implicit witness that E is a subtype of Throwable

Returns:

UIO[Future[A]]

Inherited from:
Fiber
final def toFutureWith(f: E => Throwable)(implicit trace: Trace): UIO[CancelableFuture[A]]

Converts this fiber into a scala.concurrent.Future, translating any errors to java.lang.Throwable with the specified conversion function, using Cause.squashTraceWith

Converts this fiber into a scala.concurrent.Future, translating any errors to java.lang.Throwable with the specified conversion function, using Cause.squashTraceWith

Value parameters:
f

function to the error into a Throwable

Returns:

UIO[Future[A]]

Inherited from:
Fiber
final def unit: Synthetic[E, Unit]

Maps the output of this fiber to ().

Maps the output of this fiber to ().

Returns:

Fiber[E, Unit] fiber mapped to ()

Inherited from:
Fiber
final def zip[E1 >: E, B](that: => Fiber[E1, B])(implicit zippable: Zippable[A, B]): Synthetic[E1, Out]

Named alias for <*>.

Named alias for <*>.

Type parameters:
B

type of that fiber

E1

error type

Value parameters:
that

fiber to be zipped

Returns:

Fiber[E1, (A, B)] combined fiber

Inherited from:
Fiber
final def zipLeft[E1 >: E, B](that: Fiber[E1, B]): Synthetic[E1, A]

Named alias for <*.

Named alias for <*.

Type parameters:
B

type of the fiber

E1

error type

Value parameters:
that

fiber to be zipped

Returns:

Fiber[E1, A] combined fiber

Inherited from:
Fiber
final def zipRight[E1 >: E, B](that: Fiber[E1, B]): Synthetic[E1, B]

Named alias for *>.

Named alias for *>.

Type parameters:
B

type of the fiber

E1

error type

Value parameters:
that

fiber to be zipped

Returns:

Fiber[E1, B] combined fiber

Inherited from:
Fiber
final def zipWith[E1 >: E, B, C](that: => Fiber[E1, B])(f: (A, B) => C): Synthetic[E1, C]

Zips this fiber with the specified fiber, combining their results using the specified combiner function. Both joins and interruptions are performed in sequential order from left to right.

Zips this fiber with the specified fiber, combining their results using the specified combiner function. Both joins and interruptions are performed in sequential order from left to right.

Type parameters:
B

type of that fiber

C

type of the resulting fiber

E1

error type

Value parameters:
f

function to combine the results of both fibers

that

fiber to be zipped

Returns:

Fiber[E1, C] combined fiber

Inherited from:
Fiber

Concrete fields

lazy val scope: FiberScope