Skip to content

Commit cc8bd6f

Browse files
committed
Aio documentation cleanups
1 parent 27ecfb2 commit cc8bd6f

File tree

4 files changed

+27
-19
lines changed

4 files changed

+27
-19
lines changed

NEWS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
#### New Features
44

5-
* Implemented full async I/O capabilities allowing `send_aio()` and `recv_aio()` to return Aio objects, for which the results may be called using `aio_call()`.
5+
* Implements full async I/O capabilities - `send_aio()` and `recv_aio()` now return Aio objects, for which the results may be called using `aio_call()`.
66
* New `ctx_rep()` and `ctx_req()` functions implement the full logic of an RPC server/client. Designed to be run in separate processes, the server will await data and apply an arbitrary function before returning a result, whilst the client will send data to the server and await a response.
77
* New `ncurl()` minimalistic http(s) client.
8-
* Allow setting the environment variable 'NANONEXT_TLS' prior to package installation to enable TLS where the system NNG library has been built with TLS support (using Mbed TLS).
8+
* Allows setting the environment variable 'NANONEXT_TLS' prior to package installation to enable TLS where the system NNG library has been built with TLS support (using Mbed TLS).
99

1010
#### Updates
1111

12-
* All send and receive functions, e.g. `send()`/`recv()`, gain a revamped 'mode' argument. This now permits the choice of whether to use R serialization, consolidating the functionality of the '_vec' series of functions.
12+
* All send and receive functions, e.g. `send()`/`recv()`, gain a revised 'mode' argument. This now permits the choice of whether to use R serialization, consolidating the functionality of the '_vec' series of functions.
1313
* Functions 'send_vec' and 'recv_vec' are deprecated and will be removed in a future release.
1414

1515
# nanonext 0.1.0

R/sendrecv.R

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ send <- function(socket,
6969
#'
7070
#' aio <- send_aio(pub, data.frame(a = 1, b = 2), timeout = 100)
7171
#' aio
72-
#' aio_call(aio)
72+
#' aio_call(aio)$result
7373
#'
7474
#' aio <- send_aio(pub, "message 1", mode = "raw", timeout = 100)
75-
#' aio_call(aio)
75+
#' aio_call(aio)$result
7676
#'
7777
#' close(pub)
7878
#'
@@ -225,13 +225,17 @@ recv_aio <- function(socket,
225225
#'
226226
#' @param aio An Aio (object of class 'sendAio' or 'recvAio').
227227
#'
228-
#' @return For a 'sendAio', zero on success. For a 'recvAio', either a named list
229-
#' of 2 elements: 'raw' containing the received raw vector and 'data' containing
230-
#' the converted R object, or else just the converted R object depending on
231-
#' the parameters set.
228+
#' @return The original Aio object (invisibly).
232229
#'
233-
#' @details For a 'recvAio', in case of an error in unserialisation or data
234-
#' conversion, the received raw vector will be saved in $raw to allow the
230+
#' @details For a 'sendAio', the send result will be attached to the Aio in
231+
#' \code{$result}. This will be zero on success.
232+
#'
233+
#' For a 'recvAio', the received raw vector will be attached in \code{$raw}
234+
#' (unless 'keep.raw' was set to FALSE when receiving), and the converted R
235+
#' object in \code{$data}.
236+
#'
237+
#' For a 'recvAio', in case of an error in unserialisation or data conversion,
238+
#' the received raw vector will always be saved in \code{$raw} to allow the
235239
#' data to be recovered.
236240
#'
237241
#' @examples

man/aio_call.Rd

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/send_aio.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)