Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Functor Lwt_throttle.Make

module Make (H : Hashtbl.HashedType) : 
  Swith type key = H.t

Parameters :


type key
type t
val create : rate:int -> max:int -> n:int -> t

rate : maximum number of connections per second

max : maximum waiting time (in seconds)

n : initial size of the hash table

val wait : t -> key -> bool Lwt.t

Returns false if maximum reached, true else