'Iterates through jobs in every jobstore, starts pending jobs
and figures out the next wakeup time.'

def _process_jobs(self, now):

    next_wakeup_time = None
    self._jobstores_lock.acquire()
    try:
        for (alias, jobstore) in iteritems(self._jobstores):
            for job in tuple(jobstore.jobs):
                run_times = job.get_run_times(now)
                if run_times:
                    self._threadpool.submit(self._run_job, job, run_times)
                    if job.coalesce:
                        job.runs += 1
                    else:
                        job.runs += len(run_times)
                    if job.compute_next_run_time((now + timedelta(microseconds=1))):
                        jobstore.update_job(job)
                    else:
                        self._remove_job(job, alias, jobstore)
                if (not next_wakeup_time):
                    next_wakeup_time = job.next_run_time
                elif job.next_run_time:
                    next_wakeup_time = min(next_wakeup_time, job.next_run_time)
        return next_wakeup_time
    finally:
        self._jobstores_lock.release()
