effect-io-ai

Package: effect
Module: TxPubSub

TxPubSub.awaitShutdown

Waits for the TxPubSub to be shut down.

Example (Waiting for shutdown)

import { Effect, TxPubSub } from "effect"

const program = Effect.gen(function*() {
  const hub = yield* TxPubSub.unbounded<number>()

  const fiber = yield* Effect.forkChild(TxPubSub.awaitShutdown(hub))
  yield* TxPubSub.shutdown(hub)
  yield* fiber.await
})

Signature

declare const awaitShutdown: <A>(self: TxPubSub<A>) => Effect.Effect<void>

Source

Since v2.0.0