module Jobs: sig
.. end
length t
returns the number of waiting jobs
module Priority: sig
.. end
type 'job
t
val sexp_of_t : ('job -> Sexplib.Sexp.t) -> 'job t -> Sexplib.Sexp.t
val create : unit -> 'a t
val length : 'a t -> int
length t
returns the number of waiting jobs
val is_empty : 'a t -> bool
is_empty t
returns true if there are no waiting jobs.
val add : 'job t -> Priority.t -> 'job -> unit
val start_cycle : 'a t -> max_num_jobs_per_priority:int -> unit
start_cycle t ~max_num_jobs_per_priority
enables subsequent calls of get
to
return up to max_num_jobs_per_priority
jobs of each priority level.
val get : 'job t -> 'job list
get t
gets all the jobs with the highest priority currently available, subject to
max_num_jobs_per_priority
. The obtained jobs are removed from t
.