code: func getNextJobs(n int, poolId string) ([]*Job, error) {
  	// Start a new transaction
  	t := newTransaction()
  	// Invoke a script to get all the jobs which are ready to execute based on their
  	// time parameter and whether or not they are in the queued set.
  	jobs := []*Job{}
  	t.popNextJobs(n, poolId, newScanJobsHandler(&jobs))
  
  	// Execute the transaction
  	if err := t.exec(); err != nil {
  		return nil, err
  	}
  	return jobs, nil
  }
docs: // getNextJobs queries the database and returns the next n ready jobs.