Hyperlinkv0.8.0-beta.28

PubSub

PubSub.makeAtomicUnboundedconsteffect/PubSub.ts:546
<A>(options?: { readonly replay?: number | undefined }): PubSub.Atomic<A>

Creates an unbounded atomic PubSub implementation with optional replay buffer.

When to use

Use to create the low-level storage layer for a custom PubSub whose active subscribers may retain an unbounded number of pending messages.

Gotchas

Messages published while subscribers are active can be retained without a capacity limit until those subscribers take them or unsubscribe.

Source effect/PubSub.ts:5463 lines
export const makeAtomicUnbounded = <A>(options?: {
  readonly replay?: number | undefined
}): PubSub.Atomic<A> => new UnboundedPubSub(options?.replay ? new ReplayBuffer(options.replay) : undefined)
Referenced by 1 symbols