getNextJobToRun() {
    return this.jobs
      .filter(job => job.status === Job.status.READY)
      .sort((jobA, jobB) => {
        const priorityDiff = jobB.priority - jobA.priority
        if (priorityDiff) {
          return jobB.priority - jobA.priority
        }
        return jobA.addedTime.getTime() - jobB.addedTime.getTime()
      })
      .shift()
  }
Get the next "ready" job from the queue
to be executed. The next ready job depends on -
1) Priority: higher priority always executes first
2) Time Added: if priorities are equal, the older
job executes first.