package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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.