node_modules/pomelo-scheduler/lib/schedule.js
/**
 * Return, but not remove the next valid job
 * @return Next valid job
 */
Return, but not remove the next valid job
@return Next valid job
Return but not remove the next valid job @return Next valid job
function peekNextJob(){
  if(queue.size() <= 0)
    return null;
  var job = null;
  do{
    job = map[queue.peek().id];
    if(!job) queue.pop();
  }while(!job && queue.size() > 0);
  return (!!job)?job:null;
}
function peekNextJob ( ) { if ( queue . size ( ) <= 0 ) return null ; var job = null ; do { job = map [ queue . peek ( ) . id ] ; if ( ! job ) queue . pop ( ) ; } while ( ! job && queue . size ( ) > 0 ) ; return ( ! ! job ) ? job : null ; }
Return, but not remove the next valid job
 @return Next valid job
Return but not remove the next valid job @return Next valid job