pub trait QueueMethods {
type ItemType: QueueExt + 'static + Clone + Debug;
type FeatureQueue: FeatureQueue + 'static;
// Required methods
fn capacity(&self) -> usize;
fn get_producer(&mut self) -> &mut RustScouterProducer;
fn queue(&self) -> Arc<ArrayQueue<Self::ItemType>>;
fn feature_queue(&self) -> Arc<Self::FeatureQueue>;
fn last_publish(&self) -> Arc<RwLock<DateTime<Utc>>>;
fn should_process(&self, current_count: usize) -> bool;
fn flush<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn update_last_publish(&mut self) -> Result<(), EventError> { ... }
fn publish<'life0, 'async_trait>(
&'life0 mut self,
records: ServerRecords,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn insert<'life0, 'async_trait>(
&'life0 mut self,
item: Self::ItemType,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn try_publish<'life0, 'async_trait>(
&'life0 mut self,
queue: Arc<ArrayQueue<Self::ItemType>>,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn insert_with_backpressure<'life0, 'async_trait>(
&'life0 mut self,
item: Self::ItemType,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
This is a primary trait implemented on all queues It provides the basic functionality for inserting, publishing, and flushing
Required Associated Types§
type ItemType: QueueExt + 'static + Clone + Debug
type FeatureQueue: FeatureQueue + 'static
Required Methods§
fn get_producer(&mut self) -> &mut RustScouterProducer
fn queue(&self) -> Arc<ArrayQueue<Self::ItemType>>
fn feature_queue(&self) -> Arc<Self::FeatureQueue>
fn last_publish(&self) -> Arc<RwLock<DateTime<Utc>>>
fn should_process(&self, current_count: usize) -> bool
Provided Methods§
fn update_last_publish(&mut self) -> Result<(), EventError>
Sourcefn publish<'life0, 'async_trait>(
&'life0 mut self,
records: ServerRecords,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 mut self,
records: ServerRecords,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Publish the records to the producer Remember - everything flows down from python, so the async producers need to be called in a blocking manner
Sourcefn insert<'life0, 'async_trait>(
&'life0 mut self,
item: Self::ItemType,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn insert<'life0, 'async_trait>(
&'life0 mut self,
item: Self::ItemType,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Insert an item into the queue
Sourcefn try_publish<'life0, 'async_trait>(
&'life0 mut self,
queue: Arc<ArrayQueue<Self::ItemType>>,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn try_publish<'life0, 'async_trait>(
&'life0 mut self,
queue: Arc<ArrayQueue<Self::ItemType>>,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Process the queue and publish records
Sourcefn insert_with_backpressure<'life0, 'async_trait>(
&'life0 mut self,
item: Self::ItemType,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn insert_with_backpressure<'life0, 'async_trait>(
&'life0 mut self,
item: Self::ItemType,
) -> Pin<Box<dyn Future<Output = Result<(), EventError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Backpressure handling for inserting items into the queue This will retry inserting the item a few times with exponential backoff
Implementors§
Source§impl QueueMethods for CustomQueue
Implementing primary methods
impl QueueMethods for CustomQueue
Implementing primary methods
Source§impl QueueMethods for LLMQueue
Implementing primary methods
impl QueueMethods for LLMQueue
Implementing primary methods
type ItemType = LLMRecord
type FeatureQueue = LLMRecordQueue
Source§impl QueueMethods for PsiQueue
Implementing primary methods
impl QueueMethods for PsiQueue
Implementing primary methods