sig
type 'a t
type 'a timing_wheel = 'a t
module Alarm :
sig
type 'a t
val at : 'a timing_wheel -> 'a t -> Time.t
val key : 'a timing_wheel -> 'a t -> int
val value : 'a timing_wheel -> 'a t -> 'a
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
end
val invariant :
'a Core_kernel.Invariant_intf.inv ->
'a timing_wheel Core_kernel.Invariant_intf.inv
module Level_bits :
sig
type t
val invariant : t Core_kernel.Invariant_intf.inv
val max_num_bits : int
val create_exn : int list -> t
val default : Word_size.t -> t
val num_bits : t -> int
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
end
module Config :
sig
type t
val invariant : t Core_kernel.Invariant_intf.inv
val create :
?alarm_precision:Time.Span.t -> ?level_bits:Level_bits.t -> unit -> t
val alarm_precision : t -> Time.Span.t
val level_bits : t -> Level_bits.t
val default : t
val durations : t -> Time.Span.t list
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
end
val create : config:Config.t -> start:Time.t -> 'a timing_wheel
val alarm_precision : 'a timing_wheel -> Time.Span.t
val now : 'a timing_wheel -> Time.t
val start : 'a timing_wheel -> Time.t
val is_empty : 'a timing_wheel -> bool
val length : 'a timing_wheel -> int
val iter : 'a timing_wheel -> f:('a Alarm.t -> unit) -> unit
val interval_num : 'a timing_wheel -> Time.t -> int
val now_interval_num : 'a timing_wheel -> int
val interval_num_start : 'a timing_wheel -> int -> Time.t
val interval_start : 'a timing_wheel -> Time.t -> Time.t
val advance_clock :
'a timing_wheel ->
to_:Time.t -> handle_fired:('a Alarm.t -> unit) -> unit
val alarm_upper_bound : 'a timing_wheel -> Time.t
val add : 'a timing_wheel -> at:Time.t -> 'a -> 'a Alarm.t
val add_at_interval_num : 'a timing_wheel -> at:int -> 'a -> 'a Alarm.t
val mem : 'a timing_wheel -> 'a Alarm.t -> bool
val remove : 'a timing_wheel -> 'a Alarm.t -> unit
val clear : 'a timing_wheel -> unit
val next_alarm_fires_at : 'a timing_wheel -> Time.t option
module Priority_queue :
sig
type 'a t
type 'a priority_queue = 'a t
module Elt :
sig
type 'a t
val invariant :
'a priority_queue -> 'a Invariant.t -> 'a t Invariant.t
val key : 'a priority_queue -> 'a t -> int
val value : 'a priority_queue -> 'a t -> 'a
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
end
val invariant :
'a Core_kernel.Invariant_intf.inv ->
'a priority_queue Core_kernel.Invariant_intf.inv
val create : ?level_bits:Level_bits.t -> unit -> 'a priority_queue
val length : 'a priority_queue -> int
val is_empty : 'a priority_queue -> bool
val max_representable_key : int
val min_allowed_key : 'a priority_queue -> int
val max_allowed_key : 'a priority_queue -> int
val min_elt : 'a priority_queue -> 'a Elt.t option
val min_key : 'a priority_queue -> int option
val add : 'a priority_queue -> key:int -> 'a -> 'a Elt.t
val remove : 'a priority_queue -> 'a Elt.t -> unit
val clear : 'a priority_queue -> unit
val mem : 'a priority_queue -> 'a Elt.t -> bool
val increase_min_allowed_key :
'a priority_queue ->
key:int -> handle_removed:('a Elt.t -> unit) -> unit
val iter : 'a priority_queue -> f:('a Elt.t -> unit) -> unit
val sexp_of_t :
('a -> Sexplib.Sexp.t) -> 'a priority_queue -> Sexplib.Sexp.t
end
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a timing_wheel -> Sexplib.Sexp.t
end