) t.by_handle es;
List.map (fun e -> e.value) es
with Not_found -> []
+
+ let num_timers t =
+ let cnt = ref 0 in
+ Timers_by_handle.iter (fun _ _ -> incr cnt) t.by_handle;
+ !cnt
end
type timer_callbacks =
);
dispatch_timers t ctime
+
+let num_connections t =
+ let cnt = ref 0 in
+ ConnMap.iter (fun _ _ -> incr cnt) t.conns;
+ !cnt
+
+let num_timers t = Timers.num_timers t.timers
(* this is to allow collections indexed by connection handles. *)
val handle_compare : handle -> handle -> int
+(* Connection Management *)
+
(* by default, connections are disabled for the send_done callback, and enabled for all others. *)
val register_conn : t -> Unix.file_descr -> ?enable_send_done:bool -> ?enable_recv:bool -> conn_callbacks -> handle
val remove_conn : t -> handle -> unit
val set_callbacks : t -> handle -> conn_callbacks -> unit
-(* timers *)
+
+(* Timers *)
type timer
val start_timer : t -> float (* in seconds *) -> timer_callbacks -> timer
val cancel_timer : t -> timer -> unit
-(* event dispatch *)
+
+(* Event Dispatch *)
(* dispatch t intvl will block at most for intvl seconds, and dispatch
any retrieved events and expired timers.
*)
val dispatch : t -> float -> unit
+
+
+(* Event loop management *)
+
+val num_connections : t -> int
+val num_timers : t -> int
+
+