Kinvey/node-background-task — pull request #2 by vseventer (2013-07-30 20:02:27+00:00)
Title: Reporting task progress

Workers can broadcast task progress messages by invoking a new method: `progressTask(taskId, msg)`. For creators; when calling `addTask`, a third (optional) parameter can be specified, which is a callback invoked when a progress message for that task is received.

Example:
```
worker.on('TASK_AVAILABLE', function(id) {
worker.acceptTask(id, function(msg) {
// some calculations.
worker.progressTask(id, { percentage: 50 });
// some more calculations.
worker.completeTask(id, { percentage: 100, result: calculationResult });
});
});

creator.addTask({ task: 'myTask' }, function(id, reply) {
console.log('Task completed', id, reply.calculationResult);
}, function(id, reply) {
console.log('Task in progress', id, reply.percentage);
});
```