Skip to content

Commit

Permalink
update reap() to not warn
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 23, 2023
1 parent c5a490f commit c79518d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nanonext
Type: Package
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
Version: 0.10.4.9012
Version: 0.10.4.9013
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
a socket library implementing 'Scalability Protocols', a reliable,
high-performance standard for common communications patterns including
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nanonext 0.10.4.9012 (development)
# nanonext 0.10.4.9013 (development)

#### New Features

Expand All @@ -8,10 +8,11 @@

#### Updates

* `until()` updated to be identical to `.until()`, returning FALSE instead of TRUE if the timeout has been reached.
* `nextmode()` improvements:
+ simplified function signature to take a 'refhook' argument comprising a list of serialization / unserialization functions.
+ registered 'refhook' functions apply to external pointer type objects only.
* `until()` updated to be identical to `.until()`, returning FALSE instead of TRUE if the timeout has been reached.
* `reap()` updated to not throw warnings, even if unsuccessful, for easier programmatic use.
* `pipe_notify()` arguments 'add', 'remove' and 'flag' now default to FALSE instead of TRUE for easier selective specification of the events to signal.
* Fixes regression in release 0.10.4 that caused a potential segfault using `ncurl()` with 'follow' set to TRUE when the server returns a missing or invalid relocation address.
* The weak references interface is removed as 'non-core'.
Expand Down
4 changes: 3 additions & 1 deletion R/socket.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ close.nanoSocket <- function(con, ...) invisible(.Call(rnng_close, con))
#'
#' @param con a Socket, Context, Listener or Dialer.
#'
#' @return Invisibly, an integer exit code (zero on success).
#' @return Invisibly, an integer exit code (zero on success). Warnings are not
#' generated in case of non-success.
#'
#' @details May be used on unclassed external pointers e.g. those created by
#' \code{\link{.context}}.
Expand All @@ -185,6 +186,7 @@ close.nanoSocket <- function(con, ...) invisible(.Call(rnng_close, con))
#' reap(s[["dialer"]][[1]])
#' reap(s[["listener"]][[1]])
#' reap(s)
#' reap(s)
#'
#' @export
#'
Expand Down
4 changes: 3 additions & 1 deletion man/reap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ SEXP rnng_reap(SEXP con) {
}

if (xc)
ERROR_RET(xc);
return mk_error(xc);

Rf_setAttrib(con, nano_StateSymbol, Rf_mkString("closed"));
return nano_success;
Expand Down
1 change: 1 addition & 0 deletions tests/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ nanotestaio(cs <- request(.context(req$socket), data = TRUE))
nanotest(recv(ctxn, block = 500))
nanotestz(send(ctxn, TRUE, mode = 3L, block = 500))
nanotestz(reap(ctxn))
nanotest(reap(ctxn) == 7L)
nanotestz(pipe_notify(rep, cv, add = TRUE, remove = TRUE, flag = TRUE))
nanotestz(pipe_notify(req$socket, cv = cv, add = FALSE, remove = TRUE, flag = FALSE))
nanotesterr(request_signal(err, "test", cv = cv), "valid")
Expand Down

0 comments on commit c79518d

Please sign in to comment.