module Throttle: Throttletype 'a t
include Invariant.S1
val create : continue_on_error:bool -> max_concurrent_jobs:int -> unit tcreate ~continue_on_error ~max_concurrent_jobs returns a throttle that will run up
to max_concurrent_jobs concurrently.
If some job raises an exception, then the throttle will stop, unless
continue_on_error is true.
val create_with : continue_on_error:bool -> 'a list -> 'a tcreate_with ~continue_on_error job_resources returns a throttle that will run up to
List.length job_resources concurrently, and will ensure that all running jobs are
supplied distinct elements of job_resources.type'aoutcome =[ `Aborted | `Ok of 'a | `Raised of exn ]
module Job:sig..end
val enqueue_job : 'a t -> ('a, 'b) Job.t -> unitval enqueue' : 'a t -> ('a -> 'b Deferred.t) -> 'b outcome Deferred.tenqueue t job schedules job to be run as soon as possible. Jobs are guaranteed to
be started in the order they are enqueued.
enqueue raises an exception if the throttle is dead.
val enqueue : 'a t -> ('a -> 'b Deferred.t) -> 'b Deferred.tval prior_jobs_done : 'a t -> unit Deferred.tprior_jobs_done t becomes determined when all of the jobs that were previously
enqueued in t have completed.val num_jobs_waiting_to_start : 'a t -> intmodule Sequencer:sig..end
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.tcreate ~continue_on_error ~max_concurrent_jobs returns a throttle that will run up
to max_concurrent_jobs concurrently.
If some job raises an exception, then the throttle will stop, unless
continue_on_error is true.
create_with ~continue_on_error job_resources returns a throttle that will run up to
List.length job_resources concurrently, and will ensure that all running jobs are
supplied distinct elements of job_resources.
An ('a, 'b) Job.t expects a resource of type 'a and returns a result of type
'b.
enqueue t job schedules job to be run as soon as possible. Jobs are guaranteed to
be started in the order they are enqueued.
enqueue raises an exception if the throttle is dead.
prior_jobs_done t becomes determined when all of the jobs that were previously
enqueued in t have completed.
A sequencer is a throttle that is: