MCPcopy Create free account
hub / github.com/effect-app/libs / shutdown

Method shutdown

repos/effect/packages/effect/src/PubSub.ts:2378–2386  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2376 isShutdown: MutableRef.MutableRef<boolean>
2377 ): Effect.Effect<boolean> {
2378 return Effect.suspend(() => {
2379 const deferred = Deferred.makeUnsafe<boolean>()
2380 this.offerUnsafe(elements, deferred)
2381 this.onPubSubEmptySpaceUnsafe(pubsub, subscribers)
2382 this.completeSubscribersUnsafe(pubsub, subscribers)
2383 return (MutableRef.get(isShutdown) ? Effect.interrupt : Deferred.await(deferred)).pipe(
2384 Effect.onInterrupt(() => {
2385 this.removeUnsafe(deferred)
2386 return Effect.void
2387 })
2388 )
2389 })

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.65
takeAllMethod · 0.65

Tested by

no test coverage detected