adamkewley / jobson

A platform for transforming command-line applications into a job service.
Apache License 2.0
256 stars 20 forks source link

Refactor JobManager ready for pluggable scheduling #49

Closed adamkewley closed 5 years ago

adamkewley commented 5 years ago

Currently, Jobson's internal workflow looks like this:

I'm missing out some of the details, but that's the general jist of it.

Clearly, the JobManager is having to do a lot of the legwork required to maintain Jobson's internal state. The main glaring flaws are:

All of the above combined mean that the JobManager is one of the more complicated parts of the system.

This ticket houses the refactoring effort required to make JobManager's sole responsibility scheduling jobs. The key changes needed are:

The method, or "executor", is responsible for output persistence, rather than the job manager. This shuffles some of the complexity (esp. multithreading, event emission) into the executor, where the data is emitted, and away from the scheduler.