RuntimeFlags overview
Added in v2.0.0
Table of contents
constructors
CooperativeYielding
The cooperative yielding flag determines whether the Effect runtime will yield to another fiber.
Signature
export declare const CooperativeYielding: RuntimeFlag
Added in v2.0.0
Interruption
The interruption flag determines whether or not the Effect runtime system will interrupt a fiber.
Signature
export declare const Interruption: RuntimeFlag
Added in v2.0.0
None
No runtime flags.
Signature
export declare const None: RuntimeFlag
Added in 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
export declare const OpSupervision: RuntimeFlag
Added in 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
export declare const RuntimeMetrics: RuntimeFlag
Added in 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
export declare const WindDown: RuntimeFlag
Added in v2.0.0
make
Signature
export declare const make: (...flags: ReadonlyArray<RuntimeFlag>) => RuntimeFlags
Added in v2.0.0
none
Signature
export declare const none: RuntimeFlags
Added in v2.0.0
context
disableCooperativeYielding
Signature
export declare const disableCooperativeYielding: Layer.Layer<never, never, never>
Added in v2.0.0
disableInterruption
Signature
export declare const disableInterruption: Layer.Layer<never, never, never>
Added in v2.0.0
disableOpSupervision
Signature
export declare const disableOpSupervision: Layer.Layer<never, never, never>
Added in v2.0.0
disableRuntimeMetrics
Signature
export declare const disableRuntimeMetrics: Layer.Layer<never, never, never>
Added in v2.0.0
disableWindDown
Signature
export declare const disableWindDown: Layer.Layer<never, never, never>
Added in v2.0.0
enableCooperativeYielding
Signature
export declare const enableCooperativeYielding: Layer.Layer<never, never, never>
Added in v2.0.0
enableInterruption
Signature
export declare const enableInterruption: Layer.Layer<never, never, never>
Added in v2.0.0
enableOpSupervision
Signature
export declare const enableOpSupervision: Layer.Layer<never, never, never>
Added in v2.0.0
enableRuntimeMetrics
Signature
export declare const enableRuntimeMetrics: Layer.Layer<never, never, never>
Added in v2.0.0
enableWindDown
Signature
export declare const enableWindDown: Layer.Layer<never, never, never>
Added in v2.0.0
conversions
render
Converts the provided RuntimeFlags
into a string
.
Signature
export declare const render: (self: RuntimeFlags) => string
Added in v2.0.0
toSet
Converts the provided RuntimeFlags
into a ReadonlySet<number>
.
Signature
export declare const toSet: (self: RuntimeFlags) => ReadonlySet<RuntimeFlag>
Added in v2.0.0
diffing
diff
Creates a RuntimeFlagsPatch
which describes the difference between self
and that
.
Signature
export declare const diff: {
(that: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlagsPatch.RuntimeFlagsPatch
(self: RuntimeFlags, that: RuntimeFlags): RuntimeFlagsPatch.RuntimeFlagsPatch
}
Added in v2.0.0
elements
isDisabled
Returns true
if the specified RuntimeFlag
is disabled, false
otherwise.
Signature
export declare const isDisabled: {
(flag: RuntimeFlag): (self: RuntimeFlags) => boolean
(self: RuntimeFlags, flag: RuntimeFlag): boolean
}
Added in v2.0.0
isEnabled
Returns true
if the specified RuntimeFlag
is enabled, false
otherwise.
Signature
export declare const isEnabled: {
(flag: RuntimeFlag): (self: RuntimeFlags) => boolean
(self: RuntimeFlags, flag: RuntimeFlag): boolean
}
Added in v2.0.0
getters
cooperativeYielding
Returns true
if the CooperativeYielding
RuntimeFlag
is enabled, false
otherwise.
Signature
export declare const cooperativeYielding: (self: RuntimeFlags) => boolean
Added in 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
export declare const interruptible: (self: RuntimeFlags) => boolean
Added in v2.0.0
interruption
Returns true
if the Interruption
RuntimeFlag
is enabled, false
otherwise.
Signature
export declare const interruption: (self: RuntimeFlags) => boolean
Added in v2.0.0
opSupervision
Returns true
if the OpSupervision
RuntimeFlag
is enabled, false
otherwise.
Signature
export declare const opSupervision: (self: RuntimeFlags) => boolean
Added in v2.0.0
runtimeMetrics
Returns true
if the RuntimeMetrics
RuntimeFlag
is enabled, false
otherwise.
Signature
export declare const runtimeMetrics: (self: RuntimeFlags) => boolean
Added in v2.0.0
windDown
Returns true
if the WindDown
RuntimeFlag
is enabled, false
otherwise.
Signature
export declare const windDown: (self: RuntimeFlags) => boolean
Added in 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
export type RuntimeFlag = number & {
readonly RuntimeFlag: unique symbol
}
Added in 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
export type RuntimeFlags = number & {
readonly RuntimeFlags: unique symbol
}
Added in v2.0.0
utils
differ
Constructs a differ that knows how to diff RuntimeFlags
values.
Signature
export declare const differ: Differ.Differ<RuntimeFlags, RuntimeFlagsPatch.RuntimeFlagsPatch>
Added in v2.0.0
disable
Disables the specified RuntimeFlag
.
Signature
export declare const disable: {
(flag: RuntimeFlag): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flag: RuntimeFlag): RuntimeFlags
}
Added in v2.0.0
disableAll
Disables all of the RuntimeFlag
s in the specified set of RuntimeFlags
.
Signature
export declare const disableAll: {
(flags: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flags: RuntimeFlags): RuntimeFlags
}
Added in v2.0.0
enable
Enables the specified RuntimeFlag
.
Signature
export declare const enable: {
(flag: RuntimeFlag): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flag: RuntimeFlag): RuntimeFlags
}
Added in v2.0.0
enableAll
Enables all of the RuntimeFlag
s in the specified set of RuntimeFlags
.
Signature
export declare const enableAll: {
(flags: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, flags: RuntimeFlags): RuntimeFlags
}
Added in v2.0.0
patch
Patches a set of RuntimeFlag
s with a RuntimeFlagsPatch
, returning the patched set of RuntimeFlag
s.
Signature
export declare const patch: {
(patch: RuntimeFlagsPatch.RuntimeFlagsPatch): (self: RuntimeFlags) => RuntimeFlags
(self: RuntimeFlags, patch: RuntimeFlagsPatch.RuntimeFlagsPatch): RuntimeFlags
}
Added in v2.0.0