Internal to Async -- queues of jobs to run, one at each priority level.
start_cycle t ~max_num_jobs_per_priority
enables subsequent calls of run_all
to
run up to max_num_jobs_per_priority
jobs of each priority level.
force_current_cycle_to_end
sets the number of normal jobs allowed to run in this
cycle to zero. Thus, after the currently running job completes, the scheduler will
switch to low priority jobs and then end the current cycle.
run_all t f
removes jobs from t
one at a time and applies f
to them, stopping as
soon as an unhandled exception is raised, or when no more jobs can be run at any
priority, as per ~max_num_jobs_per_priority
. The external_actions
queue is
checked at each job, and any thunk that can be dequeued is run immediately.