code: function () {
      var self = this;
      this.emitter.on('job.new', this.queueJob.bind(this));
      this.emitter.on('job.cancel', this.cancelJob.bind(this));
      this.emitter.on('job.info', function (id, respond) {
        var job = self.jobdata.get(id);
        if (job) respond(job);
      });
      function proxy(id) {
        // proxy up job.status.* updates as browser events
        var job = self.jobdata.get(id);
        var project = job && job.data.project.name;
        if (!job) return;
        self.emitter.emit('browser.update', project, this.event, [].slice.call(arguments));
      }
  
      this.io.on('job.status.**', proxy);
      this.io.on('job.cancelled', function (id) {
        // our running job was cancelled, so we need to start the next one
        var jobdata = self.jobdata.pop(id);
        self.emitter.emit('job.cancelled', id, jobdata);
        if (!jobdata) {
          jobdata = {
            _id: id
          };
          debug('Job cancelled, but no data!', id);
        }
        jobdata.errored = true;
        jobdata.error = {
          message: 'Cancelled by the user'
        };
        // self.emitter.emit('browser.update', job.project.name, 'job.status.errored', [job._id, jobdata.error])
        delete jobdata.data;
        jobdata.finished = new Date();
        self.emitter.emit('job.done', jobdata);
        if (!self.callbackMap[id]) {
          debug('Job cancelled, but no callback found. The queue is probably broken.');
          return self.queue.process();
        }
        self.callbackMap[id]();
        delete self.callbackMap[id];
      });
      // proxy up plugin events
      this.io.on('plugin.**', function () {
        self.emitter.emit.apply(self.emitter, [this.event].concat([].slice.call(arguments)));
      });
    }
docs: private API