Module Limiter_async.Resource_throttle
A resource throttle holds a static list of n resources that are handed out in a round-robin fashion to up to n concurrent jobs. A resource given to create may be re-used many times in the lifetime of t but will never be used by more than one job at a time.
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
val create_exn : resources:'a list -> continue_on_error:bool -> ?burst_size:int -> ?sustained_rate_per_sec:float -> unit -> 'a tval max_concurrent_jobs : _ t -> intval enqueue_exn : 'a t -> ?allow_immediate_run:bool -> ('a -> unit) -> unitval enqueue' : 'a t -> ('a -> 'b Async_kernel.Deferred.t) -> 'b Outcome.t Async_kernel.Deferred.t
include Common with type 'a t := 'a t
val kill : _ t -> unitkills
t, which aborts all enqueued jobs that haven't started and all jobs enqueued in the future. Ifthas already been killed, then callingkill thas no effect. Note that kill does not affect currently running jobs in any way.
val is_dead : _ t -> boolis_dead treturnstrueiftwas killed, either bykillor by an unhandled exception in a job.