concurrent_tor 1.0.0

A comprehensive scraping runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    execution::scheduler::{PlatformT, QueueJob},
    Result,
};
use async_channel::Sender;
use async_trait::async_trait;
use std::sync::{atomic::AtomicBool, Arc};

pub trait CronPlatformBuilder<P: PlatformT>: Send {
    fn set_queue_job(&mut self, queue_job: Sender<QueueJob<P>>);
    fn set_stop_flag(&mut self, stop_flag: Arc<AtomicBool>);
    fn build(&self) -> Box<dyn CronPlatform<P>>;
}

#[async_trait]
pub trait CronPlatform<P: PlatformT>: Send {
    async fn start(self: Box<Self>) -> Result<()>;
}