Lwt unix main loop engine
Type of events. An event represent a callback registered to be called when some event occurs.
iter block performs one iteration of the main loop. If
true the function must blocks until one event become
available, otherwise it should just check for available events
and return immediately.
Returns the number of events waiting for a file descriptor to become readable.
Returns the number of events waiting for a file descriptor to become writable.
Returns the number of registered timers.
An engine represent a set of functions used to register different kind of callbacks for different kind of events.
Destroy the engine, remove all its events and free its associated resources.
transfer engine moves all events from the current engine to
engine. Note that timers are reset in the destination
engine, i.e. if a timer with a delay of 2 seconds was
registered 1 second ago it will occurs in 2 seconds in the
unit -> unitand not
event -> unit
Cleanup resources associated to the engine.
Abstract class for engines.
Type of engines.
Type of libev loops.
select fds_r fds_w timeout waits for either:
fds_rto become readable
fds_wto become writable
and returns the list of readable file descriptor and the list of writable file descriptors.
Abstract class for engines based on a select-like function.
poll fds tiomeout, where
fds is a list of tuples of the
(fd, check_readable, check_writable), waits for either:
trueto become readable
trueto become writable
and returns the list of file descriptors with their readable and writable status.
Abstract class for engines based on a poll-like function.
set ?transfer ?destroy engine replaces the current engine by
the given one.
true (the default) all events from the
current engine are transferred to the new one.
true (the default) then the current engine is
destroyed before being replaced.