pub fn new(
        max_worker: usize,
        worker_fn: impl Fn(V) -> R + Send + Sync + 'static,
        worker_fn_finalize: Option<impl Fn(R) + Send + Sync + 'static>,
        finish_on_idle: bool,
    ) -> (Controller<K, V, R>, Scheduler<K, V, R>) {
        let inner = Arc::new(SchedulerInner::new(
            max_worker,
            Box::new(worker_fn) as Box<dyn Fn(V) -> R + Send + Sync + 'static>,
            worker_fn_finalize.map(|v| Box::new(v) as Box<dyn Fn(R) + Send + Sync + 'static>),
            finish_on_idle,
        ));
        (
            Controller {
                inner: inner.clone(),
            },
            Scheduler { inner },
        )
    }
/// Create a new scheduler with specified amount of max workers.
/// * `max_worker` - specifies the amount of workers to be used
/// * `worker_fn` - the function to execute that handles the "main" work, not stopped when running
/// * `worker_fn_finialize` - the "finish" function which is not called on job cancel
/// * `finish_on_idle` - on true if no channels are left on the next schedule the scheduler will drop from the tokio Runtime
///
/// You should create at least one channel before spawning the scheduler on the runtime when set to true.
Create a new scheduler with specified amount of max workers.

You should create at least one channel before spawning the scheduler on the runtime when set to true.
Create a new scheduler with specified amount of max workers . You should create at least one channel before spawning the scheduler on the runtime when set to true .
pub fn new(
        max_worker: usize,
        worker_fn: impl Fn(V) -> R + Send + Sync + 'static,
        worker_fn_finalize: Option<impl Fn(R) + Send + Sync + 'static>,
        finish_on_idle: bool,
    ) -> (Controller<K, V, R>, Scheduler<K, V, R>) {
        let inner = Arc::new(SchedulerInner::new(
            max_worker,
            Box::new(worker_fn) as Box<dyn Fn(V) -> R + Send + Sync + 'static>,
            worker_fn_finalize.map(|v| Box::new(v) as Box<dyn Fn(R) + Send + Sync + 'static>),
            finish_on_idle,
        ));
        (
            Controller {
                inner: inner.clone(),
            },
            Scheduler { inner },
        )
    }
pub fn new ( max_worker : usize , worker_fn : impl Fn ( V ) -> R + Send + Sync + ' static , worker_fn_finalize : Option < impl Fn ( R ) + Send + Sync + ' static > , finish_on_idle : bool , ) -> ( Controller < K , V , R > , Scheduler < K , V , R > ) { let inner = Arc :: new ( SchedulerInner :: new ( max_worker , Box :: new ( worker_fn ) as Box < dyn Fn ( V ) -> R + Send + Sync + ' static > , worker_fn_finalize . map ( | v | Box :: new ( v ) as Box < dyn Fn ( R ) + Send + Sync + ' static > ) , finish_on_idle , ) ) ; ( Controller { inner : inner . clone ( ) , } , Scheduler { inner } , ) }
Create a new scheduler with specified amount of max workers.
Create a new scheduler with specified amount of max workers .
max_worker
usize
worker_fn
impl Fn(V) -> R + Send + Sync + 'static
worker_fn_finalize
Option<impl Fn(R) + Send + Sync + 'static>
finish_on_idle
bool
max_worker
usize
worker_fn
impl Fn(V) -> R + Send + Sync + 'static
worker_fn_finalize
Option<impl Fn(R) + Send + Sync + 'static>
finish_on_idle
bool