[][src]Trait rsmq_async::RsmqConnection

pub trait RsmqConnection {
#[must_use]    pub fn change_message_visibility<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        message_id: &'life2 str,
        seconds_hidden: u64
    ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn create_queue<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        seconds_hidden: Option<u32>,
        delay: Option<u32>,
        maxsize: Option<i32>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub 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
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn delete_queue<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str
    ) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub 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
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn list_queues<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = RsmqResult<Vec<String>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn pop_message<'life0, 'life1, 'async_trait, E: TryFrom<RedisBytes, Error = Vec<u8>>>(
        &'life0 mut self,
        qname: &'life1 str
    ) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>
    where
        E: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn receive_message<'life0, 'life1, 'async_trait, E: TryFrom<RedisBytes, Error = Vec<u8>>>(
        &'life0 mut self,
        qname: &'life1 str,
        seconds_hidden: Option<u64>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>>
    where
        E: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn send_message<'life0, 'life1, 'async_trait, E: Into<RedisBytes> + Send>(
        &'life0 mut self,
        qname: &'life1 str,
        message: E,
        delay: Option<u64>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<String>> + Send + 'async_trait>>
    where
        E: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn set_queue_attributes<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        qname: &'life1 str,
        seconds_hidden: Option<u64>,
        delay: Option<u64>,
        maxsize: Option<i64>
    ) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Required methods

#[must_use]pub fn change_message_visibility<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    qname: &'life1 str,
    message_id: &'life2 str,
    seconds_hidden: u64
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Change the hidden time of a already sent message.

#[must_use]pub fn create_queue<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    qname: &'life1 str,
    seconds_hidden: Option<u32>,
    delay: Option<u32>,
    maxsize: Option<i32>
) -> Pin<Box<dyn Future<Output = RsmqResult<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

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

seconds_hidden: Time the messages will be hidden when they are received with the "receive_message" method.

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)

#[must_use]pub 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
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Deletes a message from the queue.

Important to use when you are using receive_message.

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

Deletes the queue and all the messages on it

#[must_use]pub 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
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Returns the queue attributes and statistics

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

Returns a list of queues in the namespace

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

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

#[must_use]pub fn receive_message<'life0, 'life1, 'async_trait, E: TryFrom<RedisBytes, Error = Vec<u8>>>(
    &'life0 mut self,
    qname: &'life1 str,
    seconds_hidden: Option<u64>
) -> Pin<Box<dyn Future<Output = RsmqResult<Option<RsmqMessage<E>>>> + Send + 'async_trait>> where
    E: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Returns a message. The message stays hidden for some time (defined by "seconds_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 "dekete_message" after this function.

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

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.

#[must_use]pub fn set_queue_attributes<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    qname: &'life1 str,
    seconds_hidden: Option<u64>,
    delay: Option<u64>,
    maxsize: Option<i64>
) -> Pin<Box<dyn Future<Output = RsmqResult<RsmqQueueAttributes>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

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

seconds_hidden: Time the messages will be hidden when they are received with the "receive_message" method.

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)

Loading content...

Implementors

impl RsmqConnection for PooledRsmq[src]

impl RsmqConnection for Rsmq[src]

Loading content...