pub struct QueueManager {
pub channel: Arc<Channel>,
pub backend: Option<Arc<dyn MqBackend>>,
pub compensator: Option<Arc<dyn Compensator>>,
pub blob_storage: Option<Arc<dyn BlobStorage>>,
pub batch_concurrency: usize,
pub compression_threshold: usize,
pub nack_policy: NackPolicy,
pub log_topic: String,
}Fields§
§channel: Arc<Channel>§backend: Option<Arc<dyn MqBackend>>§compensator: Option<Arc<dyn Compensator>>§blob_storage: Option<Arc<dyn BlobStorage>>§batch_concurrency: usize§compression_threshold: usize§nack_policy: NackPolicy§log_topic: StringImplementations§
Source§impl QueueManager
impl QueueManager
pub fn new(backend: Option<Arc<dyn MqBackend>>, capacity: usize) -> Self
pub fn from_config(cfg: &Config) -> Arc<Self> ⓘ
pub fn from_config_with_log_topic( cfg: &Config, log_topic: Option<&str>, ) -> Arc<Self> ⓘ
pub fn with_backend(&mut self, backend: Arc<dyn MqBackend>)
pub fn with_compensator(&mut self, compensator: Arc<dyn Compensator>)
pub fn with_blob_storage(&mut self, storage: Arc<dyn BlobStorage>)
pub fn with_concurrency(&mut self, concurrency: usize)
pub fn with_compression_threshold(&mut self, threshold: usize)
pub fn with_log_topic(&mut self, topic: impl Into<String>)
pub fn subscribe(&self)
pub fn get_task_push_channel(&self) -> Sender<QueuedItem<TaskEvent>>
pub fn get_task_pop_channel( &self, ) -> Arc<Mutex<Receiver<QueuedItem<TaskEvent>>>> ⓘ
pub fn get_request_pop_channel( &self, ) -> Arc<Mutex<Receiver<QueuedItem<Request>>>> ⓘ
pub fn get_request_push_channel(&self) -> Sender<QueuedItem<Request>>
pub fn get_response_push_channel(&self) -> Sender<QueuedItem<Response>>
Sourcepub fn try_send_local_response(
&self,
item: QueuedItem<Response>,
) -> Result<(), TrySendError<QueuedItem<Response>>>
pub fn try_send_local_response( &self, item: QueuedItem<Response>, ) -> Result<(), TrySendError<QueuedItem<Response>>>
Attempts to send directly to local consumers (bypassing the MQ backend). Optimization: if local consumers exist and the channel is not full, send directly to avoid serialization and network overhead.
pub fn get_response_pop_channel( &self, ) -> Arc<Mutex<Receiver<QueuedItem<Response>>>> ⓘ
pub fn get_parser_task_pop_channel( &self, ) -> Arc<Mutex<Receiver<QueuedItem<TaskParserEvent>>>> ⓘ
pub fn get_parser_task_push_channel( &self, ) -> Sender<QueuedItem<TaskParserEvent>>
pub fn get_error_pop_channel( &self, ) -> Arc<Mutex<Receiver<QueuedItem<TaskErrorEvent>>>> ⓘ
pub fn get_error_push_channel(&self) -> Sender<QueuedItem<TaskErrorEvent>>
pub fn get_log_push_channel(&self) -> Sender<QueuedItem<LogModel>>
Sourcepub async fn local_pending_count(&self) -> usize
pub async fn local_pending_count(&self) -> usize
Local pending message count across processor queues
pub async fn local_pending_breakdown( &self, ) -> (usize, usize, usize, usize, usize, usize)
pub async fn clean_storage(&self) -> Result<()>
Sourcepub async fn send_to_dlq<T>(
&self,
topic: &str,
item: &T,
reason: &str,
) -> Result<()>
pub async fn send_to_dlq<T>( &self, topic: &str, item: &T, reason: &str, ) -> Result<()>
Send a message to the Dead Letter Queue (DLQ) manually.
This is useful when the application logic decides a message cannot be processed even if the message delivery itself was successful (e.g., max logic retries exceeded).
pub async fn read_dlq( &self, topic: &str, count: usize, ) -> Result<Vec<(String, Vec<u8>, String, String)>>
Auto Trait Implementations§
impl !RefUnwindSafe for QueueManager
impl !UnwindSafe for QueueManager
impl Freeze for QueueManager
impl Send for QueueManager
impl Sync for QueueManager
impl Unpin for QueueManager
impl UnsafeUnpin for QueueManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more