uwt provides OCaml bindings for libuv. The main loop of libuv is integrated into lwt, the light-weight cooperative threads library.
Published: 16 Jul 2018
Requests are translated to lwt-threads.
Callbacks that are called continually are most of the time not translated to the usual lwt semantic.
naming conventions mirror the conventions of libuv, so you can easily consult the official libuv manual. Only the differences are explained inside
Uwt is not compatible with
lwt.unix. It's not a further
Lwt_enginein addition to
libev. However, the findlib package
uwt.extprovides alternatives to the higher level modules of
lwt.unixwith a nearly identic interface (Uwt_io, Uwt_process, Uwt_log). You can also open the module
uwt.compat) that provides aliases with module names as found in lwt (e.g.
Uwt.Main). This is necessary, if you want to use the camlp4 syntax extension of lwt.
Uwt is not thread safe. All uwt functions should be called from your main thread.
Quick install guide
$ opam install uwt
# or for the latest development version
$ opam pin add uwt --dev-repo
OCaml 4.02.1 or later
lwt 2.6.0 or later
libuv 1.8 or later
pkg-config / pkgconf
ppx_deriving (test only)
ppx_import (test only)
ounit (test only)
autoconf (repo pinning only)
$ omake all
$ omake install
libuv will be compiled locally, if is not already installed on your system. You can also explicity enforce one option:
$ omake all BUILD_LIBUV=true
$ omake all BUILD_LIBUV=false
Dev Dependencies (4)