- type nonrec t = private t
- val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
- val create_exn : now:Core_kernel.Time_ns.t -> burst_size:int -> sustained_rate_per_sec:float -> t
- A - Token_bucket.Starts_full.tis a- Token_bucket.tthat is statically guaranteed to have been called with- initial_bucket_levelequal to- burst_size. The advantage of such a guarantee is that there's a clear semantics for increasing the bucket limit (implemented in- try_increase_bucket_limit).- This is not to say that other subtypes of - Limiter.tdon't have reasonable semantics for increasing their limits in some way, but- Limiter.tis general enough that they should probably be considered on a case-by-case basis.
- val try_increase_bucket_limit : t -> new_limit:int -> Try_increase_bucket_limit_result.t
- Increases the - bucket_limitand the current- bucket_levelby the difference between the current and new bucket limits. Decreasing the bucket_limit may cause the bucket_level to become negative, breaking an invariant. If the new limit is lower than the current limit,- Unableis returned.