OCaml promises and concurrent I/O
Lwt_result.catch
now takes a function (unit -> 'a t)
rather than a promise ('a t)
. (#965)Lwt.result
type (use Stdlib.result
instead). (#968)Lwt.make_value
and Lwt.make_result
functions (use Ok
and Error
instead). (#968)waiter_of_wakener
(keep the waiter around when you create the wakener instead). (#968)Lwt_stream.on_termination
and Lwt_stream.on_terminate
(bind to Lwt_stream.closed
instead). (#968)Lwt_stream.result
type (use Stdlib.result
instead). (#968)Lwt_stream.map_exn
function (use wrap_exn
instead). (#968)Lwt.Exception_filter
for enabling/disabling system-exception catching. (#964)Lwt.reraise
an exception raising function which preserves backtraces, recommended for use in Lwt.catch
. (#963)Lwt_io.delete_recursively
for deleting a directory and its content recursively. (#984, Antonin Décimo)Lwt_preemptive.run_in_main_dont_wait
to run a function in the main preemptive thread but without waiting for the result. (Kate Deplaix, #960)Lwt_unix.handle_signal
and Lwt_engine.forwards_signal
to allow other IO libraries (such as Eio) to share signal handlers. (Thomas Leonard, #993, #991)SA_ONSTACK
on OCaml5 to avoid SIGSEGV
. (Thomas Leonard, #993, #981)Lwt_io.read_value
. (Simmo Saan, #995)Lwt.pause
behave identical to Lwt_unix.yield
. (#917, Christopher Zimmermann, Favonia)?cloexec:bool
optional arguments to functions that create file descriptors (pipe
). The ?cloexec
argument is simply forwarded to the wrapped Lwt_unix function. (#872, #911, Antonin Décimo)cppo
in lwt-react's opam file. (#946, Rizo I)Use is_blocking in dup and dup2 to fix ENOTSOCK on Windows. (#869, Antonin Décimo)
Lwt_unix.lstat was incorrectly calling Unix.stat on Win32. Fixes the behavior of Lwt_io.with_temp_dir following symlinks to directories on Win32. (#883, Antonin Décimo)
Support deleting symlinks on Windows during cleanup of Lwt_io.with_temp_dir. (#886, Antonin Décimo)
Lwt_react.S.l[2-6]_s used polymorphic equality which could cause errors when handling functional values. (#893, Jérôme Vouillon)
On Windows, treat ERROR_BROKEN_PIPE on read as zero-read instead of error. See OCaml PR #4790. (#898, Antonin Décimo)
Fix compilation under MSVC by replacing Noreturn with CAMLnoreturn. (#880, #887, Nicolás Ojeda Bär)
Lwt_bytes.blit_from_string: string complement of Lwt_bytes.blit. (#882, Hugo Heuzard)
Lwt_seq: a Seq-like data-structure with Lwt delayed nodes. (#836, #842, Zach Shipko)
Lwt_unix.auto_pause: the replacement of Lwt_unix.auto_yield that uses Lwt.pause instead of Lwt_unix.yield. (#855, #858, Favonia)
Lwt_stream.return, Lwt_stream.return_lwt: singleton stream constructors. (#864, Boning Dong)
Add ?to_dir param from Unix.symlink to Lwt_unix.symlink wrapper. (#884, Antonin Décimo)
Lwt_stream.of_lwt_seq to convert an Lwt-sequence into an Lwt-stream. (#873)
Support IPv6 (always) and PF_UNIX (with OCaml >= 4.14) socketpair on Windows. (#870, #876, Antonin Décimo, David Allsopp)
In the Lwt_unix module, add ?cloexec:bool
optional arguments to functions that create file descriptors (dup
, dup2
, pipe
, pipe_in
, pipe_out
, socket
, socketpair
, accept
, accept_n
). The ?cloexec
argument is simply forwarded to the wrapped Unix function (with OCaml >= 4.05, see PR ocaml/ocaml#650), or emulated as best-effort with Unix.set_close_on_exec
on older OCaml versions. (#327, #847, #872, #901, Antonin Décimo)
Lwt_domain: helpers for using domainslib from Lwt. (#860, Sudha Parimala)
Code quality improvement: remove an unneeded Obj.magic. (#844, Benoit Montagu)
On Windows, use the Unicode API in C stubs and functions introduced in OCaml 4.06 to handle Unicode strings. Raise the minimum requirement to OCaml 4.06 (on Windows only). (#843, #903, Antonin Décimo)
More complete coverage in the CI. (#890, #894, #896, Sora Morimoto)
Code quality improvement: use exception pattern instead of try-with. (#895, Antonin Décimo)
Code quality improvement: fix warnings on 4.13. (#899)
Fix Lwt_fmt.stderr
to actually point to stderr (#852, #850, Volker Diels-Grabsch).
Make temporary files created by Lwt_io.with_temp_dir
deletable on Windows by removing the RO bit (#849, #861, Antonin Décimo).
Handle ECONNABORTED
in Lwt_io.establish_server*
(#829, #830, Reynir Björnsson, Hannes Mehnert).
Installability
Support for OCaml 4.12 (#804, #826, Kate Deplaix).
lwt_ppx
now uses ppxlib
. This introduce a transitive dependency to OCaml.4.04 (#807, Philippe Veber).
Bugfixes
Catch exceptions in Lwt_react.of_stream
(#809, Petter A. Urkedal).
Avoid segfaults in Lwt_unix.tcsetattr
(#798, Frédéric Fortier).
Additions
fork
method in Lwt_engine
. This method is a noop in the released engines but it paves the way to a libuv-based engine (#811, Ulrik Strid, Anton Bachin).
Lwt_main.abandon_yielded_and_paused
for use in conjunction with Lwt.fork
(#789, Julien Tesson).
Lwt.wrap_in_cancelable
to complete protect
and no_cancel
(#785).
Support for IOV_MAX
in Lwt_unix.IO_vectors.system_limit
(#801, Pino Toscano).
Lwt_unix.send_msgto
(#805, Antonio Nuno Monteiro).
Lwt.dont_wait
, a more explicit alternative to Lwt.async
(#820, François Thiré).
Miscellaneous
Avoid double-reversing when traversing lists. This may change the order in which some promises are collected, which may change which of several rejection is arbitrarily selected during concurrent traversal (#784).
Numerous documentation improvements (including external contributions from Bikal Lem, Sudha Parimala, and Hannes Mehnert).
let*
and and*
in Lwt.Syntax
and Lwt_result.Syntax
(#775, Rahul Kumar).let+
and and+
(#776, Craig Ferguson).Lwt_result.both
(#775, Rahul Kumar).Lwt_unix.pread
, Lwt_unix.pwrite
, and Lwt_unix.pwrite_string
(#768, Pierre Chambart).accept4(2)
when available (#769, Pierre Chambart).Bugs fixed
exec
(#764, diagnosed Lucian Wischik).discover.ml
: don't add flags for missing system libraries (#760, #761, Olaf Hering).discover.ml
: don't run the opam
binary (#761).lwt_unix_stubs.c
(#766).