trait Managed[+R] extends Runtime[R]
A runtime that can be shutdown to release resources allocated to it.
- Alphabetic
- By Inheritance
- Managed
- Runtime
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
val
environment: R
The environment of the runtime.
The environment of the runtime.
- Definition Classes
- Runtime
-
abstract
val
platform: Platform
The platform of the runtime, which provides the essential capabilities necessary to bootstrap execution of tasks.
The platform of the runtime, which provides the essential capabilities necessary to bootstrap execution of tasks.
- Definition Classes
- Runtime
-
abstract
def
shutdown(): Unit
Shuts down this runtime and releases resources allocated to it.
Shuts down this runtime and releases resources allocated to it. Once this runtime has been shut down the behavior of methods on it is undefined and it should be discarded.
Concrete Value Members
-
final
def
as[R1](r1: R1): Managed[R1]
Constructs a new
Runtime
with the specified new environment. -
final
def
map[R1](f: (R) ⇒ R1): Managed[R1]
Constructs a new
Runtime
by mapping the environment. -
final
def
mapPlatform(f: (Platform) ⇒ Platform): Managed[R]
Constructs a new
Runtime
by mapping the platform. -
final
def
unsafeRun[E, A](zio: ⇒ ZIO[R, E, A]): A
Executes the effect synchronously, failing with zio.FiberFailure if there are any errors.
Executes the effect synchronously, failing with zio.FiberFailure if there are any errors. May fail on Scala.js if the effect cannot be entirely run synchronously.
This method is effectful and should only be done at the edges of your program.
- Definition Classes
- Runtime
-
final
def
unsafeRunAsync[E, A](zio: ⇒ ZIO[R, E, A])(k: (Exit[E, A]) ⇒ Any): Unit
Executes the effect asynchronously, eventually passing the exit value to the specified callback.
Executes the effect asynchronously, eventually passing the exit value to the specified callback.
This method is effectful and should only be invoked at the edges of your program.
- Definition Classes
- Runtime
-
final
def
unsafeRunAsync_[E, A](zio: ZIO[R, E, A]): Unit
Executes the effect asynchronously, discarding the result of execution.
Executes the effect asynchronously, discarding the result of execution.
This method is effectful and should only be invoked at the edges of your program.
- Definition Classes
- Runtime
-
final
def
unsafeRunSync[E, A](zio: ⇒ ZIO[R, E, A]): Exit[E, A]
Executes the effect synchronously.
Executes the effect synchronously. May fail on Scala.js if the effect cannot be entirely run synchronously.
This method is effectful and should only be invoked at the edges of your program.
- Definition Classes
- Runtime
-
final
def
unsafeRunTask[A](task: ⇒ ZIO[R, Throwable, A]): A
Executes the Task/RIO effect synchronously, failing with the original
Throwable
on both Cause.Fail and Cause.Die.Executes the Task/RIO effect synchronously, failing with the original
Throwable
on both Cause.Fail and Cause.Die. In addition, appends a new element to theThrowable
s "caused by" chain, with thisCause
"pretty printed" (in stackless mode) as the message. May fail on Scala.js if the effect cannot be entirely run synchronously.This method is effectful and should only be done at the edges of your program.
- Definition Classes
- Runtime
-
final
def
unsafeRunToFuture[E <: Throwable, A](zio: ZIO[R, E, A]): CancelableFuture[A]
Runs the IO, returning a Future that will be completed when the effect has been executed.
Runs the IO, returning a Future that will be completed when the effect has been executed.
This method is effectful and should only be used at the edges of your program.
- Definition Classes
- Runtime
-
final
def
withExecutor(e: Executor): Managed[R]
Constructs a new
Runtime
with the specified executor. -
final
def
withFatal(f: (Throwable) ⇒ Boolean): Managed[R]
Constructs a new
Runtime
with the specified fatal predicate. -
final
def
withReportFailure(f: (Cause[Any]) ⇒ Unit): Managed[R]
Constructs a new
Runtime
with the specified error reporter. -
final
def
withReportFatal(f: (Throwable) ⇒ Nothing): Managed[R]
Constructs a new
Runtime
with the fatal error reporter. -
final
def
withTracing(t: Tracing): Managed[R]
Constructs a new
Runtime
with the specified tracer and tracing configuration. -
final
def
withTracingConfig(config: TracingConfig): Managed[R]
Constructs a new
Runtime
with the specified tracing configuration.