GitHub

tx_pubsub

API reference for tx_pubsub.

TxPubSub[A]: a transactional publish/subscribe hub (Effect's TxPubSub).

Every subscriber gets its own TxQueue, made with the hub's strategy and capacity, and publish offers each value to all of them in one transaction. A bounded hub's publisher waits (tx_retry) while any subscriber's queue is full; dropping drops the value for full subscribers, sliding drops their oldest value, unbounded always accepts. subscribe hands out the read side of the queue for the current scope; closing the scope removes the subscriber and shuts its queue down.

Publishing inside a larger transaction is visible to subscribers only when it commits, so a rolled-back transaction publishes nothing.

Classes