package lwt
Install
Dune Dependency
Authors
Maintainers
Sources
md5=5a8d2a83ee9314781f137d147a4c62ae
sha512=b872b7abe546c431ba62fe466423d7ace8e487ebd85ea5e859f462eb4c0a6884b242d9efd4a557b6da3ae699b0b695e0a783f89a1d1147cba7d99c4ae9d2db17
doc/lwt.unix/Lwt_engine/index.html
Module Lwt_engine
Source
Lwt unix main loop engine
Events
Type of events. An event represent a callback registered to be called when some event occurs.
Event loop functions
iter block
performs one iteration of the main loop. If block
is true
the function must block until one event becomes available, otherwise it should just check for available events and return immediately.
on_readable fd f
calls f
each time fd
becomes readable.
on_readable fd f
calls f
each time fd
becomes writable.
on_timer delay repeat f
calls f
one time after delay
seconds. If repeat
is true
then f
is called each delay
seconds, otherwise it is called only one time.
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.
Simulates activity on the given file descriptor.
Called internally by Lwt_unix.fork to make sure we don't get strange behaviour
Engines
An engine represents a set of functions used to register different kinds of callbacks for different kinds of events.
Predefined engines
Type of libev loops.
Engine based on libev. If not compiled with libev support, the creation of the class will raise Lwt_sys.Not_available
.
Abstract class for engines based on a select-like function.
Abstract class for engines based on a poll-like function.
The current engine
set ?transfer ?destroy engine
replaces the current engine by the given one.
If transfer
is true
(the default) all events from the current engine are transferred to the new one.
If destroy
is true
(the default) then the current engine is destroyed before being replaced.