[][src]Function rabbit_borough::consumer::consumer::consume_with_option

pub async fn consume_with_option<T, '_, '_, '_>(
    config: &'_ JSONConfiguration,
    handler: &'_ dyn Fn(&Delivery, Option<&T>) -> HandleMessageResult,
    args: Option<&'_ T>
) -> HandleMessageResult

This is the function that the consuming is happening There are two (infinite) loops here, a. one around the consumer, which while the connection is healthy keeps dequeuing messages b. one that once the connection dies, restarts the whole process of getting a channel and setting up the consumer.

this function also allows you to pass an argument of type T into the handler