Module Async_smtp.Adjustable_throttle

type t

A throttle with adjustable max_concurrent_jobs.

val create : max_concurrent_jobs:int ‑> t
val is_dead : t ‑> bool
val enqueue : t ‑> (unit ‑> unit Async.Deferred.t) ‑> unit

Raises exception if the throttle is dead.

val set_max_concurrent_jobs : t ‑> int ‑> unit
val kill_and_flush : t ‑> unit Async.Deferred.t

Make throttle dead and wait for all currently running jobs to finish.