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

Method shutdown

packages/effect/src/internal/queue.ts:121–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 }
120
121 get shutdown(): Effect.Effect<void> {
122 return core.uninterruptible(
123 core.withFiberRuntime((state) => {
124 pipe(this.shutdownFlag, MutableRef.set(true))
125 return pipe(
126 fiberRuntime.forEachConcurrentDiscard(
127 unsafePollAll(this.takers),
128 (d) => core.deferredInterruptWith(d, state.id()),
129 false,
130 false
131 ),
132 core.zipRight(this.strategy.shutdown),
133 core.whenEffect(core.deferredSucceed(this.shutdownHook, void 0)),
134 core.asVoid
135 )
136 })
137 )
138 }
139
140 get isShutdown(): Effect.Effect<boolean> {
141 return core.sync(() => MutableRef.get(this.shutdownFlag))

Callers

nothing calls this directly

Calls 4

unsafePollAllFunction · 0.85
pipeFunction · 0.70
setMethod · 0.65
idMethod · 0.65

Tested by

no test coverage detected