Runtime

object Runtime extends RuntimePlatformSpecific
Companion:
class
trait RuntimePlatformSpecific
class Object
trait Matchable
class Any
Runtime.type

Type members

Classlikes

class Proxy[+R](underlying: Runtime[R]) extends Runtime[R]
abstract class Scoped[+R] extends Runtime[R]

A runtime that can be shutdown to release resources allocated to it.

A runtime that can be shutdown to release resources allocated to it.

Companion:
object
object Scoped
Companion:
class

Value members

Concrete methods

def addLogger(logger: ZLogger[String, Any])(implicit trace: Trace): ZLayer[Any, Nothing, Unit]
def addSupervisor(supervisor: Supervisor[Any])(implicit trace: Trace): ZLayer[Any, Nothing, Unit]
def apply[R](r: ZEnvironment[R], fiberRefs0: FiberRefs): Runtime[R]

Builds a new runtime given an environment R and a zio.FiberRefs.

Builds a new runtime given an environment R and a zio.FiberRefs.

def setBlockingExecutor(executor: Executor)(implicit trace: Trace): ZLayer[Any, Nothing, Unit]
def setExecutor(executor: Executor)(implicit trace: Trace): ZLayer[Any, Nothing, Unit]
def setReportFatal(reportFatal: Throwable => Nothing)(implicit trace: Trace): ZLayer[Any, Nothing, Unit]
def track(weak: Boolean)(implicit trace: Trace): ZLayer[Any, Nothing, Any]

A layer that adds a supervisor that tracks all forked fibers in a set. Note that this may have a negative impact on performance.

A layer that adds a supervisor that tracks all forked fibers in a set. Note that this may have a negative impact on performance.

def unsafeFromLayer[R](layer: Layer[Any, R])(implicit trace: Trace): Scoped[R]

Unsafely creates a Runtime from a ZLayer whose resources will be allocated immediately, and not released until the Runtime is shut down or the end of the application.

Unsafely creates a Runtime from a ZLayer whose resources will be allocated immediately, and not released until the Runtime is shut down or the end of the application.

This method is useful for small applications and integrating ZIO with legacy code, but other applications should investigate using ZIO.provide directly in their application entry points.

Concrete fields

val default: Runtime[Any]

The default Runtime for most ZIO applications. This runtime is configured with the the default runtime configuration, which is optimized for typical ZIO applications.

The default Runtime for most ZIO applications. This runtime is configured with the the default runtime configuration, which is optimized for typical ZIO applications.

val enableCurrentFiber: ZLayer[Any, Nothing, Unit]
lazy val enableFiberRoots: ZLayer[Any, Nothing, Unit]
val logRuntime: ZLayer[Any, Nothing, Unit]
lazy val superviseOperations: ZLayer[Any, Nothing, Unit]
val trackRuntimeMetrics: ZLayer[Any, Nothing, Unit]

Inherited fields

Inherited from:
RuntimePlatformSpecific
Inherited from:
RuntimePlatformSpecific
final val defaultFatal: Set[Class[_ <: Throwable]]
Inherited from:
RuntimePlatformSpecific
final val defaultFlags: Set[RuntimeFlag]
Inherited from:
RuntimePlatformSpecific
final val defaultLoggers: Set[ZLogger[String, Any]]
Inherited from:
RuntimePlatformSpecific
final val defaultReportFatal: Throwable => Nothing
Inherited from:
RuntimePlatformSpecific
final val defaultSupervisors: Set[Supervisor[Any]]
Inherited from:
RuntimePlatformSpecific
final val defaultYieldOpCount: Int

The default number of operations the ZIO runtime should execute before yielding to other fibers.

The default number of operations the ZIO runtime should execute before yielding to other fibers.

Inherited from:
RuntimePlatformSpecific