- naming conventions mirror the conventions of libuv, so you can easily consult the official
libuv manual. Selected parts of the manual are now included inside the mli files (credits to
Authors), the libuv manual is however more up-to-date.
- Requests are translated to lwt-threads, therefore
uv_req_tis kept internal.
- Callbacks that are called continually are most of the time not translated to the usual lwt semantic.
- Uwt is not compatible with
lwt.unix. It's not a further
Lwt_enginein addition to
- Uwt is not thread safe. All uwt functions should be called from your main thread.
Please notice, that there are subtle differences compared to
lwt.unix. Because all requests are accomplished by libuv (sometimes in parallel in different threads), you don't have that kind of low level control, that you have with
Lwt.cancel behaves differently and you won't notice it by looking at the type information.
Stream.writeand related functions can never be canceled. The analogous write functions in
Lwt_unixhowever are cancelable as long as the underlying file descriptor is not opened in blocking mode. (
Stream.readcurrently returns the only cancelable thread inside
Streamand its subclasses. But there is no guarantee that
Tcp.readwill continue to be cancelable under Windows in future libuv versions.)
- Everything that is done in work threads (e.g. File I/O, DNS resolution, etc.) is cancelable, as long as the task is just queued for execution and not already running in a parallel thread. However, it's never possible to cancel a background task in
include module type of Uwt_base
with type error = Uwt_base.error
with type 'a uv_result = 'a Uwt_base.uv_result
with type file = Uwt_base.file
with type sockaddr = Uwt_base.sockaddr
with type 'a Int_result.t = 'a Uwt_base.Int_result.t
with type Fs_types.uv_open_flag = Uwt_base.Fs_types.uv_open_flag
with type Fs_types.file_kind = Uwt_base.Fs_types.file_kind
with type Fs_types.symlink_mode = Uwt_base.Fs_types.symlink_mode
with type Fs_types.access_permission = Uwt_base.Fs_types.access_permission
with type Fs_types.stats = Uwt_base.Fs_types.stats
with type Misc.timeval = Uwt_base.Misc.timeval
with type Misc.rusage = Uwt_base.Misc.rusage
with type Misc.cpu_times = Uwt_base.Misc.cpu_times
with type Misc.cpu_info = Uwt_base.Misc.cpu_info
with type Misc.interface_address = Uwt_base.Misc.interface_address
with type Misc.handle_type = Uwt_base.Misc.handle_type
with type Misc.version = Uwt_base.Misc.version
with type Iovec_write.t = Uwt_base.Iovec_write.t
type error = Uwt_base.error =
val strerror : error -> string
error message for the given error code
val err_name : error -> string
error name for the given error code
map error to
Unix.EUNKNOWNERR is used, if the mapping is not possible
get back the original Uwt.error from an exception raised by a Uwt function
type 'a uv_result = 'a Uwt_base.uv_result
module Int_result : sig ... end
Int_result.t is used instead of
'a result, if a function returns either an error or a non-negative integer (including unit/bool).
type file = Uwt_base.file
Abstract type for a file descriptor. Unlike
Unix.file_descr it is not intended to wrap a SOCKET.
type sockaddr = Uwt_base.sockaddr
val stdin : file
File descriptor for standard input.
val stdout : file
File descriptor for standard output.
val stderr : file
File descriptor for standard error.
module Iovec_write : sig ... end
pass multiple buffers at once to a libuv write function.
module Fs_types : sig ... end
module type Fs_functions = sig ... end
module Conv : sig ... end
module Misc : sig ... end
This section contains miscellaneous functions that don't really belong in any other section.
module Sys_info : sig ... end
Information about your operating system.
module Main : sig ... end
module Fs : sig ... end
module Handle_ext : sig ... end
module Handle_fileno : sig ... end
The usage of
fileno is unsafe and strongly discouraged. But it's sometimes necessary, if you need to interact with third parties libraries. Rules:
module Stream : sig ... end
Stream handles provide an abstraction of a duplex communication channel.
Stream.t is an abstract type, libuv provides 3 stream implementations in the form of
module Tcp : sig ... end
TCP handles are used to represent both TCP streams and servers.
module Udp : sig ... end
UDP handles encapsulate UDP communication for both clients and servers.
module Tty : sig ... end
TTY handles represent a stream for the console.
module Pipe : sig ... end
Pipe handles provide an abstraction over local domain sockets on Unix and named pipes on Windows.
module Timer : sig ... end
Timer handles are used to schedule callbacks to be called in the future.
module Signal : sig ... end
Signal handles implement Unix style signal handling on a per-event loop bases.
module Poll : sig ... end
Poll handles are used to watch file descriptors for readability, writability and disconnection similar to the purpose of poll(2).
module Fs_event : sig ... end
FS Event handles allow the user to monitor a given path for changes, for example, if the file was renamed or there was a generic change in it. This handle uses the best backend for the job on each platform.
module Fs_poll : sig ... end
FS Poll handles allow the user to monitor a given path for changes. Unlike
Fs_event.t, fs poll handles use stat to detect when a file has changed so they can work on file systems where fs event handles can't.
module Process : sig ... end
Process handles will spawn a new process and allow the user to control it and establish communication channels with it using streams.
module Dns : sig ... end
libuv provides asynchronous variants of getaddrinfo and getnameinfo.
module Unix : sig ... end
Popular functions from the standard Unix module, but all calls are executed in work threads.
module C_worker : sig ... end
module Async : sig ... end
Async handles allow the user to "wakeup" the event loop and get a callback called from another (system) thread.
module Debug : sig ... end
Common helper for ad hoc debugging. Don't use them inside production code.