pub struct ConfirmsPublisher { /* private fields */ }Expand description
A publisher that awaits broker confirms for every message.
Outside a transaction each publish resolves only once the broker
confirmed the message. Between
begin_transaction and
commit messages buffer in memory; commit publishes them
in order and awaits all confirms, and abort discards the
buffer without touching the broker.
Clones share one confirm channel and one transaction buffer.
Trait Implementations§
Source§impl Clone for ConfirmsPublisher
impl Clone for ConfirmsPublisher
Source§fn clone(&self) -> ConfirmsPublisher
fn clone(&self) -> ConfirmsPublisher
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfirmsPublisher
impl Debug for ConfirmsPublisher
Source§impl Publisher for ConfirmsPublisher
impl Publisher for ConfirmsPublisher
Source§async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
Publishes msg, awaiting the broker confirm (or buffering inside a transaction).
§Errors
Returns AmqpError::NotConnected before Broker::connect resolves the connection and
AmqpError::Publish when the channel rejects the frame or the broker returns a
negative confirm.
§Cancel safety
Not cancel safe outside a transaction: dropping the future may leave the message published but unconfirmed. Inside a transaction buffering is synchronous and dropping the future is harmless.
Source§impl TransactionalPublisher for ConfirmsPublisher
impl TransactionalPublisher for ConfirmsPublisher
Source§async fn begin_transaction(&self) -> Result<(), Self::Error>
async fn begin_transaction(&self) -> Result<(), Self::Error>
Opens the buffering transaction; a no-op when one is already open.
§Errors
Never fails today; the signature leaves room for transport errors.
Source§async fn commit(&self) -> Result<(), Self::Error>
async fn commit(&self) -> Result<(), Self::Error>
Publishes the buffered messages in order and awaits every confirm.
§Errors
Returns AmqpError::Publish when any message fails to publish or the broker returns a
negative confirm. Messages already flushed stay published: publisher confirms give
durability per message, not atomicity across them (use
server_tx for that).