package colibri2

  1. Overview
  2. Docs

Time Wheel

Allows to add timestamp in the futur and get the next timestamp.

It should be (but not proved) amortized O(log(offset)) for adding an event to an offset in the futur and O(1) amortized to get the next elements

module type S = sig ... end
include S with type context := unit
type 'a t
val create : unit -> 'a t
val add : 'a t -> 'a -> int -> unit

add t v offset add the event v at the given offset in the futur

val next : 'a t -> 'a option
val next_at_same_time : 'a t -> 'a option
val find_next : 'a t -> unit
val current_time : 'a t -> int
val size : 'a t -> int
val size_at_current_time : 'a t -> int
module Make (Context : sig ... end) (_ : sig ... end) (_ : sig ... end) : S with type context := Context.t
OCaml

Innovation. Community. Security.