package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

Dune Dependency

Authors

Maintainers

Sources

v0.12.2.tar.gz
sha256=96750d5b097cdfcdf00a463e2c1083e3c62c1d92987a0751ca2cda3a1e09241f
md5=afc0271c35437c883b3c75fb821fe470

doc/core_kernel.limiter/Limiter/Token_bucket/index.html

Module Limiter.Token_bucket

Implements a basic token-bucket-based rate limiter. Users of the throttle must successfully call try_take before doing work.

type t = private limiter
val create_exn : now:Core_kernel.Time_ns.t -> burst_size:int -> sustained_rate_per_sec:float -> ?initial_bucket_level:int -> unit -> t
  • parameter initial_bucket_level

    defaults to zero

val try_take : t -> now:Core_kernel.Time_ns.t -> int -> Try_take_result.t
OCaml

Innovation. Community. Security.