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 -> tA
Token_bucket.Starts_full.tis aToken_bucket.tthat is statically guaranteed to have been called withinitial_bucket_levelequal toburst_size. The advantage of such a guarantee is that there's a clear semantics for increasing the bucket limit (implemented intry_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, butLimiter.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.tIncreases the
bucket_limitand the currentbucket_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.