Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

FiberId

23 exports Since v2.0.0 Source

Constructors

Since v2.0.0

Combine two FiberIds.

Signature

declare const combine: {
(that: FiberId): (self: FiberId) => FiberId;
(self: FiberId, that: FiberId): FiberId;
}

Combines a set of FiberIds into a single FiberId.

Signature

declare const combineAll: (fiberIds: HashSet.HashSet<FiberId>) => FiberId

Signature

declare const composite: (left: FiberId, right: FiberId) => Composite
Since v2.0.0

Creates a new FiberId.

Signature

declare const make: (id: number, startTimeSeconds: number) => FiberId
Since v2.0.0

Signature

declare const none: None
Since v2.0.0

Signature

declare const runtime: (id: number, startTimeMillis: number) => Runtime

Destructors

Since v2.0.0

Get the set of identifiers for this FiberId.

Signature

declare const ids: (self: FiberId) => HashSet.HashSet<number>

Creates a string representing the name of the current thread of execution represented by the specified FiberId.

Signature

declare const threadName: (self: FiberId) => string
Since v2.0.0

Convert a FiberId into an Option<FiberId>.

Signature

declare const toOption: (self: FiberId) => Option.Option<FiberId>
Since v2.0.0

Convert a FiberId into a HashSet<FiberId>.

Signature

declare const toSet: (self: FiberId) => HashSet.HashSet<Runtime>

Models

Composite

interface
Since v2.0.0

Signature

interface Composite extends Equal, Inspectable {
readonly _tag: "Composite";
readonly [FiberIdTypeId]: typeof FiberIdTypeId;
readonly left: FiberId;
readonly right: FiberId;
}
Since v2.0.0

Signature

type FiberId = Single | Composite

None

interface
Since v2.0.0

Signature

interface None extends Equal, Inspectable {
readonly _tag: "None";
readonly [FiberIdTypeId]: typeof FiberIdTypeId;
readonly id: -1;
readonly startTimeMillis: -1;
}

Runtime

interface
Since v2.0.0

Signature

interface Runtime extends Equal, Inspectable {
readonly _tag: "Runtime";
readonly [FiberIdTypeId]: typeof FiberIdTypeId;
readonly id: number;
readonly startTimeMillis: number;
}
Since v2.0.0

Signature

type Single = None | Runtime

Refinements

Returns true if the FiberId is a Composite, false otherwise.

Signature

declare const isComposite: (self: FiberId) => self is Composite

Returns true if the specified unknown value is a FiberId, false otherwise.

Signature

declare const isFiberId: (self: unknown) => self is FiberId
Since v2.0.0

Returns true if the FiberId is a None, false otherwise.

Signature

declare const isNone: (self: FiberId) => self is None

Returns true if the FiberId is a Runtime, false otherwise.

Signature

declare const isRuntime: (self: FiberId) => self is Runtime

Symbols

Signature

declare const FiberIdTypeId: unique symbol
Since v2.0.0

Signature

type FiberIdTypeId = typeof FiberIdTypeId

Unsafe

Unsafely creates a new FiberId.

Signature

declare const unsafeMake: (_: void) => Runtime

Utils

Returns this FiberId if it is not None, otherwise returns that FiberId.

Signature

declare const getOrElse: {
(that: FiberId): (self: FiberId) => FiberId;
(self: FiberId, that: FiberId): FiberId;
}