RuntimeFlags.ts overview
Since v2.0.0
Exports Grouped by Category
constructors
CooperativeYielding
The cooperative yielding flag determines whether the Effect runtime will yield to another fiber.
Signature
declare const CooperativeYielding: RuntimeFlag
Since v2.0.0
Interruption
The interruption flag determines whether or not the Effect runtime system will interrupt a fiber.
Signature
declare const Interruption: RuntimeFlag
Since v2.0.0
None
No runtime flags.
Signature
declare const None: RuntimeFlag
Since v2.0.0
OpSupervision
The op supervision flag determines whether or not the Effect runtime system will supervise all operations of the Effect runtime. Use of this flag will negatively impact performance, but is required for some operations, such as profiling.
Signature
declare const OpSupervision: RuntimeFlag
Since v2.0.0
RuntimeMetrics
The runtime metrics flag determines whether or not the Effect runtime system will collect metrics about the Effect runtime. Use of this flag will have a very small negative impact on performance, but generates very helpful operational insight into running Effect applications that can be exported to Prometheus or other tools via Effect Metrics.
Signature
declare const RuntimeMetrics: RuntimeFlag
Since v2.0.0
WindDown
The wind down flag determines whether the Effect runtime system will execute effects in wind-down mode. In wind-down mode, even if interruption is enabled and a fiber has been interrupted, the fiber will continue its execution uninterrupted.
Signature
declare const WindDown: RuntimeFlag
Since v2.0.0
make
Signature
declare const make: (...flags: ReadonlyArray<RuntimeFlag>) => RuntimeFlags
Since v2.0.0
none
Signature
declare const none: RuntimeFlags
Since v2.0.0
context
disableCooperativeYielding
Signature
declare const disableCooperativeYielding: Layer.Layer<never, never, never>
Since v2.0.0
disableInterruption
Signature
declare const disableInterruption: Layer.Layer<never, never, never>
Since v2.0.0
disableOpSupervision
Signature
declare const disableOpSupervision: Layer.Layer<never, never, never>
Since v2.0.0
disableRuntimeMetrics
Signature
declare const disableRuntimeMetrics: Layer.Layer<never, never, never>
Since v2.0.0
disableWindDown
Signature
declare const disableWindDown: Layer.Layer<never, never, never>
Since v2.0.0
enableCooperativeYielding
Signature
declare const enableCooperativeYielding: Layer.Layer<never, never, never>
Since v2.0.0
enableInterruption
Signature
declare const enableInterruption: Layer.Layer<never, never, never>
Since v2.0.0
enableOpSupervision
Signature
declare const enableOpSupervision: Layer.Layer<never, never, never>
Since v2.0.0
enableRuntimeMetrics
Signature
declare const enableRuntimeMetrics: Layer.Layer<never, never, never>
Since v2.0.0
enableWindDown
Signature
declare const enableWindDown: Layer.Layer<never, never, never>
Since v2.0.0
conversions
render
Converts the provided RuntimeFlags
into a string
.
Signature
declare const render: (self: RuntimeFlags) => string
Since v2.0.0
toSet
Converts the provided RuntimeFlags
into a ReadonlySet<number>
.
Signature
declare const toSet: (self: RuntimeFlags) => ReadonlySet<RuntimeFlag>
Since v2.0.0
diffing
diff
Creates a RuntimeFlagsPatch
which describes the difference between self
and that
.
Signature
declare const diff: {
(that: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlagsPatch.RuntimeFlagsPatch
(self: RuntimeFlags, that: RuntimeFlags): RuntimeFlagsPatch.RuntimeFlagsPatch
}
Since v2.0.0
elements
isDisabled
Returns true
if the specified RuntimeFlag
is disabled, false
otherwise.
Signature
declare const isDisabled: {
(flag: RuntimeFlag): (self: RuntimeFlags) => boolean
(self: RuntimeFlags, flag: RuntimeFlag): boolean
}
Since v2.0.0
isEnabled
Returns true
if the specified RuntimeFlag
is enabled, false
otherwise.
Signature
declare const isEnabled: {
(flag: RuntimeFlag): (self: RuntimeFlags) => boolean
(self: RuntimeFlags, flag: RuntimeFlag): boolean
}
Since v2.0.0
getters
cooperativeYielding
Returns true
if the CooperativeYielding
RuntimeFlag
is enabled, false
otherwise.
Signature
declare const cooperativeYielding: (self: RuntimeFlags) => boolean
Since v2.0.0
interruptible
Returns true only if the Interruption
flag is enabled and the WindDown
flag is disabled.
A fiber is said to be interruptible if interruption is enabled and the fiber is not in its wind-down phase, in which it takes care of cleanup activities related to fiber shutdown.
Signature
declare const interruptible: (self: RuntimeFlags) => boolean
Since v2.0.0
interruption
Returns true
if the Interruption
RuntimeFlag
is enabled, false
otherwise.
Signature
declare const interruption: (self: RuntimeFlags) => boolean
Since v2.0.0
opSupervision
Returns true
if the OpSupervision
RuntimeFlag
is enabled, false
otherwise.
Signature
declare const opSupervision: (self: RuntimeFlags) => boolean
Since v2.0.0
runtimeMetrics
Returns true
if the RuntimeMetrics
RuntimeFlag
is enabled, false
otherwise.
Signature
declare const runtimeMetrics: (self: RuntimeFlags) => boolean
Since v2.0.0
windDown
Returns true
if the WindDown
RuntimeFlag
is enabled, false
otherwise.
Signature
declare const windDown: (self: RuntimeFlags) => boolean
Since v2.0.0
models
RuntimeFlag (type alias)
Represents a flag that can be set to enable or disable a particular feature of the Effect runtime.
Signature
type RuntimeFlag = number & {
readonly RuntimeFlag: unique symbol
}
Since v2.0.0
RuntimeFlags (type alias)
Represents a set of RuntimeFlag
s. RuntimeFlag
s affect the operation of the Effect runtime system. They are exposed to application-level code because they affect the behavior and performance of application code.
Signature
type RuntimeFlags = number & {
readonly RuntimeFlags: unique symbol
}
Since v2.0.0
utils
differ
Constructs a differ that knows how to diff RuntimeFlags
values.
Signature
declare const differ: Differ.Differ<RuntimeFlags, RuntimeFlagsPatch.RuntimeFlagsPatch>
Since v2.0.0
disable
Disables the specified RuntimeFlag
.
Signature
declare const disable: {
(flag: RuntimeFlag): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flag: RuntimeFlag): RuntimeFlags
}
Since v2.0.0
disableAll
Disables all of the RuntimeFlag
s in the specified set of RuntimeFlags
.
Signature
declare const disableAll: {
(flags: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flags: RuntimeFlags): RuntimeFlags
}
Since v2.0.0
enable
Enables the specified RuntimeFlag
.
Signature
declare const enable: {
(flag: RuntimeFlag): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flag: RuntimeFlag): RuntimeFlags
}
Since v2.0.0
enableAll
Enables all of the RuntimeFlag
s in the specified set of RuntimeFlags
.
Signature
declare const enableAll: {
(flags: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flags: RuntimeFlags): RuntimeFlags
}
Since v2.0.0
patch
Patches a set of RuntimeFlag
s with a RuntimeFlagsPatch
, returning the patched set of RuntimeFlag
s.
Signature
declare const patch: {
(patch: RuntimeFlagsPatch.RuntimeFlagsPatch): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, patch: RuntimeFlagsPatch.RuntimeFlagsPatch): RuntimeFlags
}
Since v2.0.0