TxQueue34
Constructors
boundedconstCreates a new bounded TxQueue with the specified capacity.droppingconstCreates a new dropping TxQueue with the specified capacity that drops new items when full.slidingconstCreates a new sliding TxQueue with the specified capacity that evicts old items when full.unboundedconstCreates a new unbounded TxQueue with unlimited capacity.Models
StatetypeRepresents the state of a transactional queue with sophisticated lifecycle management.TxDequeueinterfaceNamespace containing type definitions for TxDequeue variance annotations.TxEnqueueinterfaceNamespace containing type definitions for TxEnqueue variance annotations.TxQueueinterfaceNamespace containing type definitions for TxQueue variance annotations.TxQueueStateinterfaceRepresents the shared state of a transactional queue that can be inspected.Guards
Combinators
awaitCompletionconstWaits for the queue to complete (either successfully or with failure).clearconstRemoves and returns all currently buffered elements without changing the queue state.endconstEnds a queue by signaling completion with a Cause.Done error.failconstFails the queue with the specified error, discarding any buffered items.failCauseconstCompletes the queue with the specified cause.interruptconstInterrupts the queue gracefully with the current fiber's interruption cause.isClosingconstChecks whether the queue is in the closing state.isDoneconstChecks whether the queue is done (completed or failed).isEmptyconstChecks whether the queue is empty.isFullconstChecks whether the queue is at capacity.isOpenconstChecks whether the queue is in the open state.isShutdownconstChecks whether the queue is shutdown (legacy compatibility).offerconstOffers an item to the queue and returns whether it was accepted.offerAllconstOffers multiple items to the queue, returning the items that were not accepted.peekconstWaits transactionally for the next item and returns it without removing it.pollconstTries to take an item from the queue without blocking.shutdownconstShuts down the queue immediately by clearing all items and interrupting it (legacy compatibility).sizeconstGets the current size of the queue.takeconstTakes the next item from the queue, retrying the transaction while the queue is empty.takeAllconstTakes all items from the queue.takeNconstTakes up to n items from the queue in a single transaction.