ocaml/opam-repository — pull request #1748 by bmillwood (2014-03-04 10:07:55+00:00)
Title: Core 111.03.00

## async_extra

- Add `?max_connections:int` argument to `Rpc.Connection.serve`.

`max_connections` is passed to `Tcp.Server.create`, and limits the
number of connections that an Rpc server will accept.

- Improved `Log.Rotation`:

- Made `Log.Rotation.t` abstract; use `create` rather than an
explicit record.
- Added a `` `Dated`` `naming_scheme`.
- Add `Log.Rotation.default`, for getting a sensible default
rotation scheme.
- Added an optional (but discouraged) option to symlink the latest
log file.
- Every log rotation scheme has an associated `Time.Zone.t`.
- Changed the internal representation of `Log.Rotation.t`, but
`t_of_sexp` is backwards compatible, so existing config files will
continue to work.

- Changed `Udp.bind_any` to use `Socket.bind ~reuseaddr:false`, to
ensure a unique port.
- Added `Tcp.Server.listening_socket`, which returns the socket the
server is listening on.

Changed `Tcp.Server` so that if the listening socket is closed, the
server is closed.

- Added to `Udp.Config.t` a `max_ready : int` field to prevent UDP
receive loops from starving other async jobs.
- Improved `File_tail` to cut the number of `fstat` calls in half.

`File_tail` uses a stat loop to monitor a file and continue reading
it as it grows. We had made two `fstat` invocations per loop
iteration, using `Async.Std.Unix.with_file` which constructs an
`Fd.t` and therefore does it own `fstat`. Switching to
`Core.Std.Unix.with_file` with `In_thread.run` eliminated the extra
`fstat`.

## async_unix

- Improved `Socket.accept` to abort and return `` `Socket_closed`` when
the file descriptor underlying the socket is closed.
- Added to `Socket.bind` a `?reuseaddr:bool` argument, preserving the
default as `true`.
- Added `Fd.close_started`, which becomes determined when `close` is
called on an `Fd.t`.

## bin_prot

- Fixed build on ARM.

## core

- Added `Unix.Syslog` module.
- Changed `Command.run` to no longer ignore the first element of its
`~argv` parameter.
- Made `Time.Span.to_short_string` show microsecond precision.

## core_extended

- Added `Set_lang`, a DSL for sets with constants, union, intersection,
and difference.
- In `Process`, use `epoll` rather than `select` when possible,

This prevents errors when selecting on file descriptors numbered
greater than `FD_SETSIZE` (1024).

- Removed `Syslog` module. There is now `Unix.Syslog` in core instead;
the APIs are not compatible, but they are similar.

## core_kernel

- Added `Error.to_string_hum_deprecated` that is the same as
`Error.to_string_hum` pre 109.61.
- Changed `Error.to_string_hum` so that
`Error.to_string_hum (Error.of_string s) = s`.

This fixed undesirable sexp escaping introduced in 109.61 and
restores the pre-109.61 behavior for the special case of
`Error.of_string`. A consequence of the removal of the custom
`to_string_hum` converter in 109.61 was that:

Error.to_string_hum (Error.of_string s) = Sexp.to_string_hum (Sexp.Atom s)

That introduced sexp escaping of `s`.

- Added to `Doubly_linked` functions for moving an element
within a list.

val move_to_front : 'a t -> 'a Elt.t -> unit
val move_to_back : 'a t -> 'a Elt.t -> unit
val move_after : 'a t -> 'a Elt.t -> anchor:'a Elt.t -> unit
val move_before : 'a t -> 'a Elt.t -> anchor:'a Elt.t -> unit

- Improved `Core_map_unit_tests.Unit_tests` to allow arbitrary data
in the map, not just `ints`.

This was done by eta expansion.

## custom_printf

- Simplified the code generated by `pa_custom_printf` to make it
more readable.

## re2

- Fixed a bug with `replace_exn` and anchoring.

Fixed this bug:

$ R.replace_exn ~f:(fun _ -> "a") (R.create_exn "^") "XYZ";;
- : string = "aXaYaZa"

$ R.replace_exn ~f:(fun _ -> "a") (R.create_exn "^X") "XXXYXXZ";;
- : string = "aaaYXXZ"

## textutils

- Changed `Textutils.Console` to not reference `Async.Log`, so that
building inline benchmark runners no longer requires building `Async`.

The change makes `Textutils`, and by extension `Core_extended` and
`Core_bench`, not depend on `Async`.