Skip to content

Releases: r-lib/nanonext

nanonext 1.8.0

09 Feb 19:25
8f17d0b

Choose a tag to compare

New Features

  • Adds http_server() for creating HTTP and WebSocket servers with TLS/SSL support.
  • Adds handler() for dynamic HTTP request handling with custom callbacks.
  • Adds handler_ws() for WebSocket connections with on_message, on_open, and on_close callbacks.
  • Adds handler_stream() for HTTP streaming using chunked transfer encoding, supporting Server-Sent Events (SSE), NDJSON, and custom streaming formats.
  • Adds format_sse() helper for formatting Server-Sent Events messages.
  • Adds static content handlers: handler_file() and handler_directory() for serving files, handler_inline() for in-memory content, and handler_redirect() for HTTP redirects.
  • ncurl() and variants now accept response = TRUE to return all response headers.
  • Listeners now automatically resolve port 0 to the actual port assigned by the OS. The listener's url attribute is updated when the listener starts.
  • Adds race_aio() to wait for and return the index of the first resolved Aio in a list of Aios.

Updates

  • Closing an already closed stream now returns 'errorValue' 7 | Object closed rather than error.
  • random() now only accepts 'n' between 1 and 1024. Supplying 0 will error (#238).
  • Fixes a potential crash when random() or write_cert() is called in a fresh session before any other TLS-related functions have been called, and nanonext has been compiled against a system Mbed TLS with PSA crypto enabled. (#242).
  • Fixes a potential crash when a serialization hook errors (#225).
  • Performance improvements for serialization, streaming, and async sends.
  • Bundled 'libmbedtls' updated to latest 3.6.5 LTS branch release (#234).
  • Building from source no longer requires xz.

nanonext 1.7.2

03 Nov 11:08
94bbe81

Choose a tag to compare

Updates

  • pipe_notify(flag = tools::SIGTERM) will now raise the signal with a 200ms grace period to allow a process to exit normally (#212).
  • parse_url() drops 'rawurl', 'host' and 'requri' from the output vector as these can be derived from the other parts (#209).

nanonext 1.7.1

01 Oct 08:23
1cb8803

Choose a tag to compare

Updates

  • stop_aio() now resets the R interrupt flags (#194).
  • The cv arguments at recv_aio() and request() have been simplified to accept just a 'conditionVariable' or NULL.

nanonext 1.7.0

01 Sep 17:42
ccd0314

Choose a tag to compare

Behavioural Changes

  • The promises method for ncurlAio has been updated for ease of use (#176):
    • Returns a list of 'status', 'headers' and 'data'.
    • Rejects only if an NNG error is returned (all HTTP status codes are resolved).
  • Improved behaviour when using serial_config() configurations applied to a socket.
    If the serialization hook function errors or otherwise fails to return a raw vector, this will error out rather than be silently ignored (#173).

New Features

  • A 'recvAio' returned by request() now has an attribute id, which is the integer ID of the context passed to it.

Updates

  • opt() for a boolean NNG option now correctly returns a logical value instead of an integer (#186).
  • as.promise() method for recvAio and ncurlAio objects made robust for high-throughput cases (#171).

nanonext 1.6.2

14 Jul 09:01
68eb478

Choose a tag to compare

Updates

  • Fixes extremely rare cases of unresolvedValue being returned by fulfilled promises (#163).

nanonext 1.6.1

23 Jun 08:52
339fe8e

Choose a tag to compare

Updates

  • ncurl() and variants now accept request data supplied as a raw vector (thanks @thomasp85, #158).
  • cv_reset() now correctly resets the flag in the case a flag event has already been registered with pipe_notify().
  • The previous listen() and dial() argument error, removed in v1.6.0, is now defunct.
  • The previous serial_config() argument vec, unutilised since v1.6.0, is removed.
  • Fixes package installation with 'libmbedtls' in a non-standard filesystem location, even if known to the compiler (thanks @tdhock, #150).
  • Bundled 'libnng' updated to 1.11.0 release.

nanonext 1.6.0

20 May 06:54
f147d61

Choose a tag to compare

New Features

  • serial_config() now accepts vector arguments to register multiple custom serialization configurations.
  • Adds ip_addr() for returning the local network IPv4 address of all network adapters, named by interface.
  • Adds pipe_id() for returning the integer pipe ID for a resolved 'recvAio'.
  • Adds write_stdout() which performs a non-buffered write to stdout, to avoid interleaved messages when used concurrently by different processes.
  • Adds read_stdin() which performs a read from stdin on a background thread, relayed via an 'inproc' socket so that it may be consumed via recv() or recv_aio().
  • request() gains integer argument id. This may be specified to have a special payload sent asynchronously upon timeout (to communicate with the connected party).

Updates

  • listen() and dial() argument error is replaced with fail to specify the failure mode - 'warn', 'error', or 'none' to just return an 'errorValue'.
    • Any existing usage of error = TRUE will work only until the next release.
  • Partial matching is no longer enabled for the mode argument to send/receive functions.
  • send_aio() without keeping a reference to the return value no longer potentially drops sends (thanks @wch, #129).
  • pipe_notify() no longer requires any particular sequencing of closing the socket and garbage collection of the socket / 'conditionVariable' (#143).
  • More robust interruption on non-Windows platforms when tools::SIGINT is supplied to the flag argument of pipe_notify() (thanks @LennardLux, #97).
  • Installation from source specifying 'INCLUDE_DIR' and 'LIB_DIR' environment variables works again, correcting a regression in v1.5.2 (#104).
  • Windows bi-arch source builds for R <= 4.1 using rtools40 and earlier work again (regression since v1.5.1) (thanks @daroczig, #107).
  • Bundled 'libnng' 1.10.2 pre-release updated with latest patches.
  • Package is re-licensed under the MIT license.

nanonext 1.5.2

18 Mar 16:54
08b1ace

Choose a tag to compare

Updates

  • write_cert() argument 'cn' now defaults to '127.0.0.1' instead of 'localhost'.
  • messenger() now exits cleanly, correcting a regression in nanonext 1.5.0 (#87).
  • Promises created from 'recvAio' and 'ncurlAio' now reject in exactly the same way whether or not they were resolved at time of creation (#89).
  • Bundled 'libnng' updated to 1.10.2 pre-release.
    • With this library version, a 'req' socket with option 'req:resend-time' set as 0 now frees the message as soon as the send has completed without waiting for the reply.

nanonext 1.5.1

16 Feb 22:54
71b2606

Choose a tag to compare

Updates

  • pipe_notify() drops argument 'cv2' for signalling 2 condition variables on one pipe event. Use signal forwarders %~>% instead.
  • The abillity to lock() and unlock() sockets is removed.
  • Renders it safe to serialize 'nano' and 'aio' objects - they will be inactive when unserialized.
  • Unified Windows build system now compiles 'libmbedtls' and 'libnng' from source even on R <= 4.1 using Rtools40 or earlier.
  • Minimum supported 'libnng' version increased to 1.9.0.

nanonext 1.5.0

28 Jan 00:04
92da3ca

Choose a tag to compare

Library Updates

  • Bundled 'libnng' updated to latest 1.10.1 release.
  • Bundled 'libmbedtls' updated to latest 3.6.2 LTS branch release.

Updates

  • nano() updated with the 'poly' protocol, with 'pipe' argument enabled for the send methods.
  • write_cert() no longer displays a status message when interactive (thanks @wlandau, #74).
  • Removes partial matching when using $, [[ or [ on an object inheriting from class 'nano'.
  • Fixes a rare hang on socket close that was possible on Windows platforms for IPC connections (#76).