Trait Ack

Source
pub trait Ack<Task, Res, Codec> {
    type Context;
    type AckError: Error;

    // Required method
    fn ack(
        &mut self,
        ctx: &Self::Context,
        response: &Response<Res>,
    ) -> impl Future<Output = Result<(), Self::AckError>> + Send;
}
Expand description

A trait for acknowledging successful processing This trait is called even when a task fails. This is a way of a [Backend] to save the result of a job or message

Required Associated Types§

Source

type Context

The data to fetch from context to allow acknowledgement

Source

type AckError: Error

The error returned by the ack

Required Methods§

Source

fn ack( &mut self, ctx: &Self::Context, response: &Response<Res>, ) -> impl Future<Output = Result<(), Self::AckError>> + Send

Acknowledges successful processing of the given request

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T, Res: Clone + Send + Sync + Serialize, Ctx: Clone + Send + Sync, Cdc: Codec> Ack<T, Res, Cdc> for Sender<(Ctx, Response<Cdc::Compact>)>
where Cdc::Error: Debug, Cdc::Compact: Send,

Source§

type AckError = SendError

Source§

type Context = Ctx

Source§

async fn ack( &mut self, ctx: &Self::Context, result: &Response<Res>, ) -> Result<(), Self::AckError>

Implementors§