Module Jobs

module Jobs: sig .. end
Internal to async -- queues of jobs to run, one at each priority level.

type t 
include Invariant.S
val create : unit -> t
val length : t -> int
length t returns the number of waiting jobs
val is_empty : t -> bool
is_empty t returns true if there are no waiting jobs.
val add : t -> Priority.t -> Job.t -> unit
val clear : t -> unit
clear t removes all jobs from t.
val start_cycle : t ->
max_num_jobs_per_priority:Import.Max_num_jobs_per_priority_per_cycle.t ->
unit
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.
val force_current_cycle_to_end : t -> unit
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.
val run_all : t -> (Job.t -> unit) -> (unit, exn) Core.Std.Result.t
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.
val sexp_of_t : t -> Sexplib.Sexp.t

length t returns the number of waiting jobs

is_empty t returns true if there are no waiting jobs.

clear t removes all jobs from t.

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.