lib/schedule.js
function getNextJob(){
  let job = null;

  while(!job && queue.size() > 0){
    let id = queue.pop().id;
    job = map[id];
  }

  return (!!job)?job:null;
}
function getNextJob(){
  let job = null;

  while(!job && queue.size() > 0){
    let id = queue.pop().id;
    job = map[id];
  }

  return (!!job)?job:null;
}
function getNextJob ( ) { let job = null ; while ( ! job && queue . size ( ) > 0 ) { let id = queue . pop ( ) . id ; job = map [ id ] ; } return ( ! ! job ) ? job : null ; }
Return and remove the next valid job
@return Next valid job
Return and remove the next valid job