MCPcopy Create free account
hub / github.com/Effect-TS/effect / shutdown

Function shutdown

packages/effect/src/PubSub.ts:752–760  ·  view source on GitHub ↗
(self: PubSub<A>)

Source from the content-addressed store, hash-verified

750 * @since 2.0.0
751 */
752export const shutdown = <A>(self: PubSub<A>): Effect.Effect<void> =>
753 Effect.uninterruptible(Effect.withFiber((fiber) => {
754 MutableRef.set(self.shutdownFlag, true)
755 return Scope.close(self.scope, Exit.interrupt(fiber.id)).pipe(
756 Effect.andThen(self.strategy.shutdown),
757 Effect.when(self.shutdownHook.open),
758 Effect.asVoid
759 )
760 }))
761
762/**
763 * Checks effectfully whether `shutdown` has been called, returning `true`

Callers

nothing calls this directly

Calls 5

whenMethod · 0.80
setMethod · 0.65
pipeMethod · 0.65
closeMethod · 0.65
interruptMethod · 0.45

Tested by

no test coverage detected