title: Kue callback when job is completed
body: <p>My main Node instance forks a worker process, which accepts messages over IPC (using the built-in Node <code>process.send()</code> and <code>process.on('message'...</code>) which are objects containing information about new jobs to add to <a href="https://github.com/learnboost/kue" rel="nofollow">Kue</a>.  It then processes those jobs.</p>
  
  <p>My main Node instance calls something like this:</p>
  
  <pre><code>worker.send({jobType:'filesystem', operation: 'delete', path: fileDir});
  </code></pre>
  
  <p>and the worker instance does something like this:</p>
  
  <pre><code>jobs.create(message.jobType, message).save();
  
  jobs.process('filesystem', function(job, done) {
      fs.delete(job.data.path, function(err) {
          done(err);
      });
  });
  </code></pre>
  
  <p>and the job completes successfully.</p>
  
  <p>How can I get callback-like functionality in my main Node instance when the job is completed?  How can I return some results to the main Node instance from the worker instance?</p>