Module Limiter.Token_bucket

module Token_bucket: sig .. end
Implements a basic token bucket based rate limiter. Users of the throttle must successfully call try_take before doing work.

type t = private Limiter.limiter 
val create_exn : now:Time.t ->
burst_size:float ->
sustained_rate_per_sec:float ->
?initial_bucket_level:float -> unit -> t
val try_take : t ->
now:Time.t ->
float -> [ `Asked_for_more_than_bucket_size | `Taken | `Unable ]