Worker system with pluggable components
var workit = ;var configured = workit;// orvar configured = workit;// create a configured workervar worker = configured;// create a task managervar taskManager = configured;
var worker = ...;workerstart;process;
var taskManager = ...;// queue a new tasktaskManager;// optionally you can add tags that can be searched for latertaskManager;/*There are some cases where you'd like to have a pull "queue" ratherthan a push queue. In this case, you'll need to tell the TaskManagerabout the task when it gets pulled. You can call this method and returnthe value it creates to the requesting client.*/taskManager;// or track a task by IDvar taskTracker = taskManager;// you can track the start and finish eventstaskTracker;taskTracker;// tasks currently workingtaskManager;// tasks older than 5 seconds agotaskManager;
To see debug and status messages from
work-it, just add
DEBUG=work-it:* to your environment.