MCPcopy Index your code
hub / github.com/Effect-TS/effect / Runtime

Class Runtime

packages/effect/src/internal/fiberId.ts:67–97  ·  view source on GitHub ↗

@internal

Source from the content-addressed store, hash-verified

65
66/** @internal */
67class Runtime implements FiberId.Runtime {
68 readonly [FiberIdTypeId]: FiberId.FiberIdTypeId = FiberIdTypeId
69 readonly _tag = OP_RUNTIME
70 constructor(
71 readonly id: number,
72 readonly startTimeMillis: number
73 ) {}
74 [Hash.symbol](): number {
75 return Hash.cached(this, Hash.string(`${FiberIdSymbolKey}-${this._tag}-${this.id}-${this.startTimeMillis}`))
76 }
77 [Equal.symbol](that: unknown): boolean {
78 return isFiberId(that) &&
79 that._tag === OP_RUNTIME &&
80 this.id === that.id &&
81 this.startTimeMillis === that.startTimeMillis
82 }
83 toString() {
84 return format(this.toJSON())
85 }
86 toJSON() {
87 return {
88 _id: "FiberId",
89 _tag: this._tag,
90 id: this.id,
91 startTimeMillis: this.startTimeMillis
92 }
93 }
94 [NodeInspectSymbol]() {
95 return this.toJSON()
96 }
97}
98
99/** @internal */
100class Composite implements FiberId.Composite {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected