[−][src]Struct rsmq_async_lite::Rsmq
THe main object of this library. Creates/Handles the redis connection and contains all the methods
Implementations
impl<T> Rsmq<T> where
T: Serialize + DeserializeOwned + Clone,
[src]
T: Serialize + DeserializeOwned + Clone,
pub async fn new(options: RsmqOptions) -> RsmqResult<Rsmq<T>>
[src]
Creates a new RSMQ instance, including its connection
pub fn new_with_pool(
options: RsmqOptions,
pool: Pool<RedisConnectionManager>
) -> Rsmq<T>
[src]
options: RsmqOptions,
pool: Pool<RedisConnectionManager>
) -> Rsmq<T>
Special method for when you already have a redis-rs connection and you don't want redis_async to create a new one.
pub async fn create_queue<'_, '_>(
&'_ mut self,
qname: &'_ str,
seconds_hidden: Option<u64>,
delay: Option<u64>,
maxsize: Option<i64>
) -> RsmqResult<()>
[src]
&'_ mut self,
qname: &'_ str,
seconds_hidden: Option<u64>,
delay: Option<u64>,
maxsize: Option<i64>
) -> RsmqResult<()>
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. Default: 30 seconds
delay: Time the messages will be delayed before being delivered. Default: 0
maxsize: Maximum size in bytes of each message in the queue. Needs to be between 1024 or 65536 or -1 (unlimited size). Default: 65536
pub async fn delete_queue<'_, '_>(
&'_ mut self,
qname: &'_ str
) -> RsmqResult<()>
[src]
&'_ mut self,
qname: &'_ str
) -> RsmqResult<()>
Deletes the queue and all the messages on it
pub async fn has_queue<'_, '_>(&'_ mut self, qname: &'_ str) -> RsmqResult<bool>
[src]
Return true if queue:
pub async fn list_queues<'_>(&'_ mut self) -> RsmqResult<Vec<String>>
[src]
Returns a list of queues in the namespace
pub async fn send_message<'_, '_, '_>(
&'_ mut self,
qname: &'_ str,
message: &'_ T,
delay: Option<u64>
) -> RsmqResult<String>
[src]
&'_ mut self,
qname: &'_ str,
message: &'_ T,
delay: Option<u64>
) -> RsmqResult<String>
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.
pub async fn delete_message<'_, '_, '_>(
&'_ mut self,
qname: &'_ str,
id: &'_ str
) -> RsmqResult<bool>
[src]
&'_ mut self,
qname: &'_ str,
id: &'_ str
) -> RsmqResult<bool>
Deletes a message from the queue.
Important to use when you are using receive_message.
pub async fn change_message_visibility<'_, '_, '_>(
&'_ mut self,
qname: &'_ str,
message_id: &'_ str,
seconds_hidden: u64
) -> RsmqResult<()>
[src]
&'_ mut self,
qname: &'_ str,
message_id: &'_ str,
seconds_hidden: u64
) -> RsmqResult<()>
Change the hidden time of a already sent message.
pub async fn pop_message<'_, '_>(
&'_ mut self,
qname: &'_ str
) -> RsmqResult<Option<RsmqMessage<T>>>
[src]
&'_ mut self,
qname: &'_ str
) -> RsmqResult<Option<RsmqMessage<T>>>
Deletes and returns a message. Be aware that using this you may end with deleted & unprocessed messages.
pub async fn receive_message<'_, '_>(
&'_ mut self,
qname: &'_ str,
seconds_hidden: Option<u64>
) -> RsmqResult<Option<RsmqMessage<T>>>
[src]
&'_ mut self,
qname: &'_ str,
seconds_hidden: Option<u64>
) -> RsmqResult<Option<RsmqMessage<T>>>
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.
pub async fn set_queue_attributes<'_, '_>(
&'_ mut self,
qname: &'_ str,
seconds_hidden: Option<u64>,
delay: Option<u64>,
maxsize: Option<i64>
) -> RsmqResult<RsmqQueueAttributes>
[src]
&'_ mut self,
qname: &'_ str,
seconds_hidden: Option<u64>,
delay: Option<u64>,
maxsize: Option<i64>
) -> RsmqResult<RsmqQueueAttributes>
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)
pub async fn get_queue_attributes<'_, '_>(
&'_ mut self,
qname: &'_ str
) -> RsmqResult<RsmqQueueAttributes>
[src]
&'_ mut self,
qname: &'_ str
) -> RsmqResult<RsmqQueueAttributes>
Returns the queue attributes and statistics
Trait Implementations
impl<T: Clone + Serialize + DeserializeOwned> Clone for Rsmq<T>
[src]
impl<T: Debug + Serialize + DeserializeOwned + Clone> Debug for Rsmq<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Rsmq<T>
impl<T> Send for Rsmq<T> where
T: Send,
T: Send,
impl<T> Sync for Rsmq<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Rsmq<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Rsmq<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,