Module Reddit_api_kernel.Rate_limiter_state_machine

module When_to_send : sig ... end
type t
val sexp_of_t : t -> Sexplib0.Sexp.t

Constructors

val by_headers : t
val with_minimum_delay : delay:Core.Time_ns.Span.t -> t
val combine : t list -> t

Events

val sent_request_unchecked : t -> now:Core.Time_ns.t -> t

sent_request_unchecked should called immediately after sending a request. It is the caller's responsibility to first call wait_until.

val received_response : t -> Cohttp.Response.t -> t

Accessors

val wait_until : t -> When_to_send.t