willdo 0.0.1

Task manager with DAG
Documentation
#![doc = include_str!("README.md")]

pub mod commander;
pub mod progress;
pub mod repository;
pub mod runner;

pub use self::runner::simple::Simple;
use self::{progress::Progress, repository::JobRepository};
use crate::job::JobId;
use commander::Instance;
use futures_lite::Stream;
use core::{future::Future, pin::Pin};

/// Boxed Interpretter instance
pub type BoxInstance = Box<dyn Instance + Send>;
/// Boxed error
pub type BoxError = Box<dyn core::error::Error + Sync + Send>;
/// Boxed async stream
pub type BoxStream<'s, T> = Pin<Box<dyn 's + Stream<Item = T> + Send>>;
/// Boxed async future
pub type BoxFuture<'f, T> = Pin<Box<dyn 'f + Future<Output = T> + Send>>;

/// Can run a [JobRepository]
pub trait Runner {
    /// Run a [JobRepository] to reach given goals
    /// report on progress, at minimum job started and completed
    fn run<'f, 'j: 'f, J: 'j + JobRepository + Send + Unpin>(
        &self,
        jobs: J,
        goals: &[Box<str>],
    ) -> BoxStream<'f, (JobId, Progress)>;
}