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