(self: PubSub<A>)
| 750 | * @since 2.0.0 |
| 751 | */ |
| 752 | export 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` |