Trait BackgroundTask

Source
pub trait BackgroundTask {
    type DataItem: QueueExt + Send + Sync + 'static;
    type Processor: FeatureQueue + Send + Sync + 'static;

    // Provided method
    fn start_background_task(
        &self,
        data_queue: Arc<ArrayQueue<Self::DataItem>>,
        processor: Arc<Self::Processor>,
        producer: RustScouterProducer,
        last_publish: Arc<RwLock<DateTime<Utc>>>,
        runtime: Arc<Runtime>,
        stop_rx: Receiver<()>,
        queue_capacity: usize,
        label: &'static str,
    ) -> Result<(), EventError> { ... }
}

Required Associated Types§

Source

type DataItem: QueueExt + Send + Sync + 'static

Source

type Processor: FeatureQueue + Send + Sync + 'static

Provided Methods§

Source

fn start_background_task( &self, data_queue: Arc<ArrayQueue<Self::DataItem>>, processor: Arc<Self::Processor>, producer: RustScouterProducer, last_publish: Arc<RwLock<DateTime<Utc>>>, runtime: Arc<Runtime>, stop_rx: Receiver<()>, queue_capacity: usize, label: &'static str, ) -> Result<(), EventError>

Implementors§

Source§

impl BackgroundTask for CustomQueue

Source§

impl BackgroundTask for PsiQueue

Psi requires a background timed-task as a secondary processing mechanism i.e. Its possible that queue insertion is slow, and so we need a background task to process the queue at a regular interval