RuntimeFlags
Constructors
CooperativeYielding
Signature
declare const CooperativeYielding: RuntimeFlag;Interruption
The interruption flag determines whether or not the Effect runtime system will interrupt a fiber.
Signature
declare const Interruption: RuntimeFlag;Signature
declare const make: (...flags: ReadonlyArray<RuntimeFlag>) => RuntimeFlags;Signature
declare const none: RuntimeFlags;No runtime flags.
Signature
declare const None: RuntimeFlag;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;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;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;Context
disableCooperativeYielding
Signature
declare const disableCooperativeYielding: Layer.Layer<never>;disableInterruption
Signature
declare const disableInterruption: Layer.Layer<never>;disableOpSupervision
Signature
declare const disableOpSupervision: Layer.Layer<never>;disableRuntimeMetrics
Signature
declare const disableRuntimeMetrics: Layer.Layer<never>;disableWindDown
Signature
declare const disableWindDown: Layer.Layer<never>;enableCooperativeYielding
Signature
declare const enableCooperativeYielding: Layer.Layer<never>;enableInterruption
Signature
declare const enableInterruption: Layer.Layer<never>;enableOpSupervision
Signature
declare const enableOpSupervision: Layer.Layer<never>;enableRuntimeMetrics
Signature
declare const enableRuntimeMetrics: Layer.Layer<never>;enableWindDown
Signature
declare const enableWindDown: Layer.Layer<never>;Conversions
Converts the provided RuntimeFlags into a string.
Signature
declare const render: (self: RuntimeFlags) => string;Converts the provided RuntimeFlags into a ReadonlySet<number>.
Signature
declare const toSet: (self: RuntimeFlags) => ReadonlySet<RuntimeFlag>;Diffing
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;
};Returns true if the specified RuntimeFlag is enabled, false otherwise.
Signature
declare const isEnabled: {
(flag: RuntimeFlag): (self: RuntimeFlags) => boolean;
(self: RuntimeFlags, flag: RuntimeFlag): boolean;
};Getters
cooperativeYielding
Returns true if the CooperativeYielding RuntimeFlag is enabled, false otherwise.
Signature
declare const cooperativeYielding: (self: RuntimeFlags) => boolean;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;interruption
Returns true if the Interruption RuntimeFlag is enabled, false otherwise.
Signature
declare const interruption: (self: RuntimeFlags) => boolean;opSupervision
Returns true if the OpSupervision RuntimeFlag is enabled, false otherwise.
Signature
declare const opSupervision: (self: RuntimeFlags) => boolean;runtimeMetrics
Returns true if the RuntimeMetrics RuntimeFlag is enabled, false otherwise.
Signature
declare const runtimeMetrics: (self: RuntimeFlags) => boolean;Returns true if the WindDown RuntimeFlag is enabled, false otherwise.
Signature
declare const windDown: (self: RuntimeFlags) => boolean;Models
RuntimeFlag type
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;
};RuntimeFlags type
Represents a set of RuntimeFlags. RuntimeFlags 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;
};Utils
Constructs a differ that knows how to diff RuntimeFlags values.
Signature
declare const differ: Differ.Differ<RuntimeFlags, RuntimeFlagsPatch.RuntimeFlagsPatch>;Disables the specified RuntimeFlag.
Signature
declare const disable: {
(flag: RuntimeFlag): (self: RuntimeFlags) => RuntimeFlags;
(self: RuntimeFlags, flag: RuntimeFlag): RuntimeFlags;
};disableAll
Disables all of the RuntimeFlags in the specified set of RuntimeFlags.
Signature
declare const disableAll: {
(flags: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlags;
(self: RuntimeFlags, flags: RuntimeFlags): RuntimeFlags;
};Enables the specified RuntimeFlag.
Signature
declare const enable: {
(flag: RuntimeFlag): (self: RuntimeFlags) => RuntimeFlags;
(self: RuntimeFlags, flag: RuntimeFlag): RuntimeFlags;
};Enables all of the RuntimeFlags in the specified set of RuntimeFlags.
Signature
declare const enableAll: {
(flags: RuntimeFlags): (self: RuntimeFlags) => RuntimeFlags;
(self: RuntimeFlags, flags: RuntimeFlags): RuntimeFlags;
};Patches a set of RuntimeFlags with a RuntimeFlagsPatch, returning the patched set of RuntimeFlags.
Signature
declare const patch: {
(patch: RuntimeFlagsPatch): (self: RuntimeFlags) => RuntimeFlags;
(self: RuntimeFlags, patch: RuntimeFlagsPatch): RuntimeFlags;
};
The cooperative yielding flag determines whether the Effect runtime will yield to another fiber.