module Lwt_main:Main loop and event queuesig
..end
val run : 'a Lwt.t -> 'a
run t
calls the Lwt scheduler repeatedly until t
terminates,
then returns the value returned by the thread. It t
fails with
an exception, this exception is raised.
Note that you should avoid using run
inside threads
run
returns.run
are serialized: an
invocation of run
will not terminate before all
subsequent invocations are terminated.val exit_hooks : (unit -> unit Lwt.t) Lwt_sequence.t
Notes:
val at_exit : (unit -> unit Lwt.t) -> unit
at_exit hook
adds hook at the left of exit_hooks
This part has two purpose:
Lwt.wakeup_paused
must be called before collecting
sources of event and before doing the blocking select or
equivalent.typefd_set =
Unix.file_descr list
typecurrent_time =
float Lazy.t
Unix.gettimeofday
if not needed.typeselect =
fd_set ->
fd_set ->
fd_set ->
float option ->
current_time * fd_set * fd_set * fd_set
val select_filters : (current_time -> select -> select) Lwt_sequence.t
val apply_filters : select -> select
apply_filters select
apply all the filters on the given select
function.val default_select : select
Unix.select
.val default_iteration : unit -> unit
default_select
, the, call the resulting select function.val main_loop_iteration : (unit -> unit) Pervasives.ref
val min_timeout : float option -> float option -> float option
min_timeout a b
returns the smallest timeout of two
timeouts.