Giter VIP home page Giter VIP logo

async-jobs's People

Contributors

reynoldsbd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

async-jobs's Issues

CPU threshold

User should be able to set a max CPU threshold using a "builder pattern" method on Scheduler. When threshold is provided, Scheduler should wait until system CPU usage is below threshold before scheduling new concurrent jobs.

Reload job graph

It is possible for a job to have side effects which necessitate reloading the entire job graph. Add a new Outcome::Reload variant (see #4) representing this scenario.

When a job returns the reload outcome, stop executing jobs and load a new Schedule based on the originally submitted job. Then restart execution.

As an optimization, it would be interesting if we could somehow preserve the state of the old (pre-reload) schedule and map it onto the new reloaded schedule. Intent of this would be to prevent unnecessary/duplicate execution of jobs after a reload.

Skip jobs with unchanged dependencies

This feature has two parts:

  1. Allow individual jobs to report an unchanged outcome
  2. If all of a job's dependencies reported unchanged, then skip execution of that job and set its outcome to unchanged as well

For part 1, create a new enum:

#[non_exhaustive] // so we can add more outcomes in the future
pub enum Outcome {
    Success,
    Unchanged,
}

Change return type of Job::run to Result<Outcome, Self::Error>

Update JobState::Succeeded variant to include outcome value

For part 2, update Schedule::mark_complete to accept the full Result of job run and store job outcome appropriately. Also add logic to recursively set unchanged outcome for dependent jobs

Context

Add type parameter to Job trait and Scheduler struct representing a Context that is passed by reference to all Job methods. Intent is to eliminate the need for each Job instance to carry its own references to shared state.

If possible, default Context type should be the unit struct ().

Error handling behavior

User should be able to configure how the scheduler responds to a job failure:

  • halt - immediately drop all actively running jobs
  • finish - allow actively running jobs to finish, but do not schedule any more jobs
  • continue - continue scheduling as many jobs as possible

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.