Got a thousand jobs to do? Get an execution plan!
Got a thousand jobs to do? Get an execution plan! Work provides a means to build a hierarchy of jobs, executed in the order, and with the strategy provided. Build your own dashboard to monitor events / progress or use the one built it. Work makes use of the Composite Pattern.
var work = require"work";var housework = name: "housework" addname: "play music"parallel: truecommand: launchPlaylistargs: "Al Green"name: "wash dishes"command: washargs: pots pans cutleryonProgress:name: "change music"// half way through washing the dishesif thisprogresspercentComplete == 50launchPlaylist"Metal";onComplete:name: "wipe worktops"command: washargs: worktopsonSuccess:name: "procrastinate"command: postFacebookStatusargs: "I'm a model parent and my kids are clever. "name: "mop floor"command: washargs: kitchenFloor hallFloor;// get to work, monitoring progress on stdouthouseworkmonitorprocessstdoutrun;
$ npm install work
$ git clone https://github.com/75lb/work.git$ cd work$ npm test