Trait rsmq_async::RsmqConnection

source ·
pub trait RsmqConnection {
    // Required methods
    fn change_message_visibility<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        message_id: &'life2 str,
        hidden: Duration
    ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn create_queue<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        hidden: Option<Duration>,
        delay: Option<Duration>,
        maxsize: Option<i32>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_message<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        id: &'life2 str
    ) -> Pin<Box<dyn Future<Output = RsmqResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_queue<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str
    ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_queue_attributes<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str
    ) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_queues<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = RsmqResult<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn pop_message<'life0, 'life1, 'async_trait, E>(
        &'life0 mut self,
        qname: &'life1 str
    ) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>
       where E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn receive_message<'life0, 'life1, 'async_trait, E>(
        &'life0 mut self,
        qname: &'life1 str,
        hidden: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>
       where E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn send_message<'life0, 'life1, 'async_trait, E>(
        &'life0 mut self,
        qname: &'life1 str,
        message: E,
        delay: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<String>> + Send + 'async_trait>>
       where E: 'async_trait + Into<RedisBytes> + Send,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_queue_attributes<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        hidden: Option<Duration>,
        delay: Option<Duration>,
        maxsize: Option<i64>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

source

fn change_message_visibility<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, qname: &'life1 str, message_id: &'life2 str, hidden: Duration ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Change the hidden time of a already sent message.

hidden has a max time of 9_999_999 for compatibility reasons to this library JS version counterpart

source

fn create_queue<'life0, 'life1, 'async_trait>( &'life0 mut self, qname: &'life1 str, hidden: Option<Duration>, delay: Option<Duration>, maxsize: Option<i32> ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new queue. Attributes can be later modified with “set_queue_attributes” method

hidden: Time the messages will be hidden when they are received with the “receive_message” method. It has a max time of 9_999_999 for compatibility reasons to this library JS version counterpart

delay: Time the messages will be delayed before being delivered

maxsize: Maximum size in bytes of each message in the queue. Needs to be between 1024 or 65536 or -1 (unlimited size)

source

fn delete_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, qname: &'life1 str, id: &'life2 str ) -> Pin<Box<dyn Future<Output = RsmqResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes a message from the queue.

Important to use when you are using receive_message.

source

fn delete_queue<'life0, 'life1, 'async_trait>( &'life0 mut self, qname: &'life1 str ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes the queue and all the messages on it

source

fn get_queue_attributes<'life0, 'life1, 'async_trait>( &'life0 mut self, qname: &'life1 str ) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the queue attributes and statistics

source

fn list_queues<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = RsmqResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of queues in the namespace

source

fn pop_message<'life0, 'life1, 'async_trait, E>( &'life0 mut self, qname: &'life1 str ) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>
where E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes and returns a message. Be aware that using this you may end with deleted & unprocessed messages.

source

fn receive_message<'life0, 'life1, 'async_trait, E>( &'life0 mut self, qname: &'life1 str, hidden: Option<Duration> ) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>
where E: 'async_trait + TryFrom<RedisBytes, Error = Vec<u8>>, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns a message. The message stays hidden for some time (defined by “hidden” argument or the queue settings). After that time, the message will be redelivered. In order to avoid the redelivery, you need to use the “delete_message” after this function.

hidden has a max time of 9_999_999 for compatibility reasons to this library JS version counterpart.

source

fn send_message<'life0, 'life1, 'async_trait, E>( &'life0 mut self, qname: &'life1 str, message: E, delay: Option<Duration> ) -> Pin<Box<dyn Future<Output = RsmqResult<String>> + Send + 'async_trait>>
where E: 'async_trait + Into<RedisBytes> + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a message to the queue. The message will be delayed some time (controlled by the “delayed” argument or the queue settings) before being delivered to a client.

source

fn set_queue_attributes<'life0, 'life1, 'async_trait>( &'life0 mut self, qname: &'life1 str, hidden: Option<Duration>, delay: Option<Duration>, maxsize: Option<i64> ) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Modify the queue attributes. Keep in mind that “hidden” and “delay” can be overwritten when the message is sent. “hidden” can be changed by the method “change_message_visibility”

hidden: Time the messages will be hidden when they are received with the “receive_message” method. It has a max time of 9_999_999 for compatibility reasons to this library JS version counterpart

delay: Time the messages will be delayed before being delivered

maxsize: Maximum size in bytes of each message in the queue. Needs to be between 1024 or 65536 or -1 (unlimited size)

Object Safety§

This trait is not object safe.

Implementors§