Package: effect
Module: PubSub
Creates a bounded atomic PubSub implementation with optional replay buffer.
When to use
Use to provide bounded message storage when building a custom PubSub with
make and an explicit delivery strategy.
Details
Pass either a capacity number or an options object with capacity and
optional replay. A positive replay value enables a replay buffer for late
subscribers, and fractional replay sizes are rounded up.
Gotchas
The capacity must be greater than zero; invalid capacities throw synchronously before an atomic implementation is created.
See
make for constructing a PubSub from an atomic implementation and delivery strategymakeAtomicUnbounded for an atomic implementation without a bounded capacitybounded for the higher-level backpressure constructordropping for the higher-level dropping constructorsliding for the higher-level sliding constructorSignature
declare const makeAtomicBounded: <A>(capacity: number | { readonly capacity: number; readonly replay?: number | undefined; }) => PubSub.Atomic<A>
Since v4.0.0