pub struct ServerTxPublisher { /* private fields */ }Expand description
A publisher backed by AMQP server transactions (tx.select / tx.commit / tx.rollback).
Between begin_transaction and
commit messages accumulate on the broker inside the
channel transaction and become visible atomically at commit;
abort rolls them back server-side. Outside a transaction
publish behaves like the fire-and-forget publisher.
Clones share the transactional channel and its open/closed state. Interleaving publish
and begin_transaction/commit from concurrent tasks is not supported: which side of the
transaction boundary a concurrent publish lands on would be a race either way.
Trait Implementations§
Source§impl Clone for ServerTxPublisher
impl Clone for ServerTxPublisher
Source§fn clone(&self) -> ServerTxPublisher
fn clone(&self) -> ServerTxPublisher
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 ServerTxPublisher
impl Debug for ServerTxPublisher
Source§impl Publisher for ServerTxPublisher
impl Publisher for ServerTxPublisher
Source§async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
async fn publish(&self, msg: OutgoingMessage<'_>) -> Result<(), Self::Error>
Publishes msg: into the open server transaction, or plainly when none is open.
§Errors
Returns AmqpError::NotConnected before Broker::connect resolves the connection and
AmqpError::Publish when the channel rejects the frame.
§Cancel safety
Not cancel safe: dropping the future may leave the message queued in the transaction or not.
Source§impl TransactionalPublisher for ServerTxPublisher
impl TransactionalPublisher for ServerTxPublisher
Source§async fn begin_transaction(&self) -> Result<(), Self::Error>
async fn begin_transaction(&self) -> Result<(), Self::Error>
Opens a server transaction (tx.select on first use); a no-op when one is open.
§Errors
Returns AmqpError::NotConnected before Broker::connect resolves the connection and
AmqpError::Publish when the transactional channel cannot be set up.