[][src]Trait celery::Broker

pub trait Broker {
    type Delivery: TryIntoMessage + Clone + Debug;
    type DeliveryError: Into<Error>;
    type Consumer: IntoIterator<Item = Result<Self::Delivery, Self::DeliveryError>, IntoIter = Self::ConsumerIterator> + Stream<Item = Result<Self::Delivery, Self::DeliveryError>> + StreamExt;
    type ConsumerIterator: Iterator<Item = Result<Self::Delivery, Self::DeliveryError>>;
    fn consume<'life0, 'life1, 'async_trait>(
        &'life0 self,
        queue: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Self::Consumer, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn ack<'life0, 'async_trait>(
        &'life0 self,
        delivery: Self::Delivery
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn send<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        message: &'life1 Message,
        queue: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; }

A message Broker is used as the transport for producing or consuming tasks.

Associated Types

Loading content...

Required methods

fn consume<'life0, 'life1, 'async_trait>(
    &'life0 self,
    queue: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Self::Consumer, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Consume messages from a queue.

If the connection is successful, this should return a future stream of Results where an Ok value is a Self::Delivery type that can be coerced into a Message and an Err value is a Self::DeliveryError type that can be coerced into an Error.

fn ack<'life0, 'async_trait>(
    &'life0 self,
    delivery: Self::Delivery
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Acknowledge a Delivery for deletion.

fn send<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    message: &'life1 Message,
    queue: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

Send a Message into a queue.

Loading content...

Implementors

impl Broker for AMQPBroker[src]

type Delivery = Delivery

type DeliveryError = Error

type Consumer = Consumer

type ConsumerIterator = ConsumerIterator

Loading content...