Struct Scheduler

Source
pub struct Scheduler<ExB: ExecutorBuilder> { /* private fields */ }
Expand description

The entry point of the crate, implementing the job scheduling logic

§Example

use captain_workflow_manager::{executor, Scheduler};
let executor = executor::SlurmExecutorBuilder { max_jobs: 10_000 };
let scheduler = Scheduler::new(executor);
scheduler.run(some_jobs)?;

Implementations§

Source§

impl<ExB: ExecutorBuilder> Scheduler<ExB>

Source

pub fn new(ex_builder: ExB) -> Self

Creates a new scheduler objects, with the provided ExecutorBuilder

Executor builders can be found in the executor module, or custom ones can be implemented.

Source

pub fn run<J: JobUnit>(self, final_job_units: Vec<J>) -> Result<(), Error<J>>

Run each job in final_job_units and its transitive dependencies.

A job won’t be run if its output file is already present. (Currently no finer dependency freshness management is attempted.) Moreover, dependencies of such jobs won’t be run either.

Auto Trait Implementations§

§

impl<ExB> Freeze for Scheduler<ExB>
where ExB: Freeze,

§

impl<ExB> RefUnwindSafe for Scheduler<ExB>
where ExB: RefUnwindSafe,

§

impl<ExB> Send for Scheduler<ExB>
where ExB: Send,

§

impl<ExB> Sync for Scheduler<ExB>
where ExB: Sync,

§

impl<ExB> Unpin for Scheduler<ExB>
where ExB: Unpin,

§

impl<ExB> UnwindSafe for Scheduler<ExB>
where ExB: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.