Skip to main content

DagScheduler

Struct DagScheduler 

Source
pub struct DagScheduler<Q: JobQueue, A: ArtifactStore> { /* private fields */ }
Expand description

Event-driven DAG scheduler.

Listens for JobEvents from the queue and enqueues downstream jobs when their dependencies are satisfied. Replaces the inline orchestrator.

Implementations§

Source§

impl<Q: JobQueue, A: ArtifactStore> DagScheduler<Q, A>

Source

pub fn new(queue: Arc<Q>, artifacts: Arc<A>, state: SharedState) -> Self

Source

pub async fn start_workflow( &self, workflow_id: &str, ) -> Result<(), SchedulerError>

Initiate a workflow run: reset all jobs to Queued, then enqueue root jobs.

Source

pub async fn cancel_workflow( &self, workflow_id: &str, ) -> Result<(), SchedulerError>

Cancel a running workflow: cancel all pending/active jobs.

Source

pub async fn run(self: Arc<Self>)

Run the scheduler event loop. Listens for queue events and drives the DAG. This should be spawned as a background task.

Auto Trait Implementations§

§

impl<Q, A> Freeze for DagScheduler<Q, A>

§

impl<Q, A> !RefUnwindSafe for DagScheduler<Q, A>

§

impl<Q, A> Send for DagScheduler<Q, A>

§

impl<Q, A> Sync for DagScheduler<Q, A>

§

impl<Q, A> Unpin for DagScheduler<Q, A>

§

impl<Q, A> UnsafeUnpin for DagScheduler<Q, A>

§

impl<Q, A> !UnwindSafe for DagScheduler<Q, A>

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.