Struct hedwig::AcknowledgeableMessage
source · pub struct AcknowledgeableMessage<A, M> {
pub ack_token: A,
pub message: M,
}
Expand description
A received message which can be acknowledged to prevent re-delivery by the backing message service.
See the documentation for acknowledging messages on Consumer
Fields§
§ack_token: A
The acknowledgement token which executes the ack/nack/modify operations
message: M
The underlying message
Implementations§
source§impl<A, M> AcknowledgeableMessage<A, M>where
A: AcknowledgeToken,
impl<A, M> AcknowledgeableMessage<A, M>where
A: AcknowledgeToken,
sourcepub async fn ack(self) -> Result<M, A::AckError>
pub async fn ack(self) -> Result<M, A::AckError>
Acknowledge this message, declaring that processing was successful and the message should not be re-delivered to consumers.
sourcepub async fn nack(self) -> Result<M, A::NackError>
pub async fn nack(self) -> Result<M, A::NackError>
Negatively acknowledge this message, declaring that processing was unsuccessful and the message should be re-delivered to consumers.
sourcepub async fn modify_deadline(
&mut self,
seconds: u32
) -> Result<(), A::ModifyError>
pub async fn modify_deadline( &mut self, seconds: u32 ) -> Result<(), A::ModifyError>
Modify the acknowledgement deadline for this message to the given number of seconds.
The new deadline will typically be this number of seconds after the service receives this modification requesst, though users should check their implementation’s documented behavior.
Trait Implementations§
source§impl<A, M> Deref for AcknowledgeableMessage<A, M>
impl<A, M> Deref for AcknowledgeableMessage<A, M>
Auto Trait Implementations§
impl<A, M> RefUnwindSafe for AcknowledgeableMessage<A, M>where
A: RefUnwindSafe,
M: RefUnwindSafe,
impl<A, M> Send for AcknowledgeableMessage<A, M>
impl<A, M> Sync for AcknowledgeableMessage<A, M>
impl<A, M> Unpin for AcknowledgeableMessage<A, M>
impl<A, M> UnwindSafe for AcknowledgeableMessage<A, M>where
A: UnwindSafe,
M: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request