Skip to main content

safely_apply

Function safely_apply 

Source
pub async fn safely_apply<'a, F, Fut>(
    endpoint: &'a EndpointHandle,
    delivery: Box<Delivery>,
    callback: F,
) -> Result<(), Error>
where F: FnOnce(&'a EndpointHandle, Box<Delivery>) -> Fut, Fut: Future<Output = Result<(), Error>>,
Expand description

Execute the async callback to process the delivery in a transaction like manner. The delivery is ACKed, NACKed (and requeued) or REJECTed depending on the Error returned.