Crabbit::Consumer
Inherits Enumerable < Reference < Object
Recovering pull or callback consumer for one RabbitMQ stream.
Pull mode uses #receive, #receive?, or #each. Callback mode is created
by Environment#consumer(stream, options) { |delivery| ... } and marks each
delivery processed after the handler returns. A consumer reconnects and
resumes from the latest contiguous broker-delivery prefix until closed.
Constructors
Instance methods
Idempotently unsubscribes, stores any pending automatic offset, and closes the delivery queue.
Yields deliveries until the consumer closes.
Enumerable consumption acknowledges after the block returns, including
when it raises. Use #receive for explicit acknowledgement control.
Receives one delivery, waiting while the queue is empty.
The caller owns acknowledgement and must invoke Delivery#processed!
when processing is complete. Raises ResourceClosedError after close.
Receives one delivery, waiting while the queue is empty, or returns nil
after the consumer closes and the queue drains.
The caller must invoke Delivery#processed! for every returned delivery.
Stores an absolute offset for this named consumer.
Raises ConfigurationError when ConsumerOptions#name is absent.
Stores the offset of delivery for this named consumer.
Raises ArgumentError when the delivery belongs to another stream.