pub trait GmqQueue: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn is_recv(&self) -> bool;
fn status(&self) -> Status;
fn set_handler(&mut self, handler: Arc<dyn EventHandler>);
fn clear_handler(&mut self);
fn set_msg_handler(&mut self, handler: Arc<dyn MessageHandler>);
fn connect(&mut self) -> Result<(), Box<dyn StdError>>;
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_msg<'life0, 'async_trait>(
&'life0 self,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The operations for queues.
Required Methods§
Sourcefn set_handler(&mut self, handler: Arc<dyn EventHandler>)
fn set_handler(&mut self, handler: Arc<dyn EventHandler>)
To set the queue event handler.
Sourcefn clear_handler(&mut self)
fn clear_handler(&mut self)
To remove the queue event handler.
Sourcefn set_msg_handler(&mut self, handler: Arc<dyn MessageHandler>)
fn set_msg_handler(&mut self, handler: Arc<dyn MessageHandler>)
To set the queue message handler.