Skip to content

Commit a37e6d1

Browse files
committed
retain compat with released packages
1 parent c01ab7e commit a37e6d1

File tree

10 files changed

+26
-19
lines changed

10 files changed

+26
-19
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: nanonext
22
Type: Package
33
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
4-
Version: 1.2.1.9013
4+
Version: 1.2.1.9014
55
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
66
a socket library implementing 'Scalability Protocols', a reliable,
77
high-performance standard for common communications patterns including

NAMESPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export("%~>%")
4747
export("opt<-")
4848
export(.advance)
4949
export(.context)
50+
export(.keep)
5051
export(.mark)
51-
export(.promise)
5252
export(.unresolved)
5353
export(call_aio)
5454
export(call_aio_)
@@ -89,6 +89,7 @@ export(request)
8989
export(send)
9090
export(send_aio)
9191
export(serial_config)
92+
export(set_promise_context)
9293
export(socket)
9394
export(stat)
9495
export(status_code)

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nanonext 1.2.1.9013 (development)
1+
# nanonext 1.2.1.9014 (development)
22

33
#### New Features
44

R/aio.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ as.promise.recvAio <- function(x) {
371371
if (unresolved(x)) {
372372
promise <- promises::then(
373373
promises::promise(
374-
function(resolve, reject)
375-
.promise(x, environment())
374+
function(resolve, reject) .keep(x, environment())
376375
),
377376
onFulfilled = function(value)
378377
if (is_error_value(value)) stop(nng_error(value)) else value
@@ -397,7 +396,7 @@ as.promise.recvAio <- function(x) {
397396
#'
398397
is.promising.recvAio <- function(x) TRUE
399398

400-
#' Create Promise
399+
#' Keep Promise
401400
#'
402401
#' Internal package function.
403402
#'
@@ -412,4 +411,9 @@ is.promising.recvAio <- function(x) TRUE
412411
#' @keywords internal
413412
#' @export
414413
#'
415-
.promise <- function(x, ctx) .Call(rnng_create_promise, x, ctx)
414+
.keep <- function(x, ctx) .Call(rnng_set_promise_context, x, ctx)
415+
416+
#' @rdname dot-keep
417+
#' @export
418+
#'
419+
set_promise_context <- .keep

R/ncurl.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ as.promise.ncurlAio <- function(x) {
246246
if (unresolved(x)) {
247247
promise <- promises::then(
248248
promises::promise(
249-
function(resolve, reject)
250-
.promise(x, environment())
249+
function(resolve, reject) .keep(x, environment())
251250
),
252251
onFulfilled = function(value)
253252
if (value != 200L)

man/dot-promise.Rd renamed to man/dot-keep.Rd

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

src/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ static const R_CallMethodDef callMethods[] = {
129129
{"rnng_aio_stop", (DL_FUNC) &rnng_aio_stop, 1},
130130
{"rnng_clock", (DL_FUNC) &rnng_clock, 0},
131131
{"rnng_close", (DL_FUNC) &rnng_close, 1},
132-
{"rnng_create_promise", (DL_FUNC) &rnng_create_promise, 2},
133132
{"rnng_ctx_close", (DL_FUNC) &rnng_ctx_close, 1},
134133
{"rnng_ctx_create", (DL_FUNC) &rnng_ctx_create, 1},
135134
{"rnng_ctx_open", (DL_FUNC) &rnng_ctx_open, 1},
@@ -170,6 +169,7 @@ static const R_CallMethodDef callMethods[] = {
170169
{"rnng_serial_config", (DL_FUNC) &rnng_serial_config, 4},
171170
{"rnng_set_marker", (DL_FUNC) &rnng_set_marker, 1},
172171
{"rnng_set_opt", (DL_FUNC) &rnng_set_opt, 3},
172+
{"rnng_set_promise_context", (DL_FUNC) &rnng_set_promise_context, 2},
173173
{"rnng_signal_thread_create", (DL_FUNC) &rnng_signal_thread_create, 2},
174174
{"rnng_sleep", (DL_FUNC) &rnng_sleep, 1},
175175
{"rnng_socket_lock", (DL_FUNC) &rnng_socket_lock, 2},

src/nanonext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ SEXP rnng_aio_result(SEXP);
259259
SEXP rnng_aio_stop(SEXP);
260260
SEXP rnng_clock(void);
261261
SEXP rnng_close(SEXP);
262-
SEXP rnng_create_promise(SEXP, SEXP);
263262
SEXP rnng_ctx_close(SEXP);
264263
SEXP rnng_ctx_create(SEXP);
265264
SEXP rnng_ctx_open(SEXP);
@@ -301,6 +300,7 @@ SEXP rnng_send_aio(SEXP, SEXP, SEXP, SEXP, SEXP);
301300
SEXP rnng_serial_config(SEXP, SEXP, SEXP, SEXP);
302301
SEXP rnng_set_marker(SEXP);
303302
SEXP rnng_set_opt(SEXP, SEXP, SEXP);
303+
SEXP rnng_set_promise_context(SEXP, SEXP);
304304
SEXP rnng_signal_thread_create(SEXP, SEXP);
305305
SEXP rnng_sleep(SEXP);
306306
SEXP rnng_socket_lock(SEXP, SEXP);

src/sync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ SEXP rnng_request(SEXP con, SEXP data, SEXP sendmode, SEXP recvmode, SEXP timeou
498498

499499
}
500500

501-
SEXP rnng_create_promise(SEXP x, SEXP ctx) {
501+
SEXP rnng_set_promise_context(SEXP x, SEXP ctx) {
502502

503503
if (TYPEOF(x) != ENVSXP)
504504
return R_NilValue;

tests/tests.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ nanotestp(p <- tryCatch(collect_pipe(r), error = function(e) NULL))
211211
if (!is.null(p)) nanotest(is_nano(p))
212212
nanotest(.mark())
213213
nanotestaio(r <- send_aio(if (is_nano(p)) p else rep, "", timeout = 500))
214-
if (later) nanotestn(.promise(r, new.env()))
214+
if (later) nanotestn(.keep(r, new.env()))
215215
nanotesterr(collect_pipe(r), "valid")
216216
nanotest(req$recv(mode = 8L, block = 500)[4L] == 1L)
217217
nanotest(!.mark(FALSE))
@@ -571,8 +571,8 @@ nanotesterr(collect_aio_(list("a")), "object is not an Aio or list of Aios")
571571
nanotesterr(collect_aio(list(fakesock)), "object is not an Aio or list of Aios")
572572
nanotestn(stop_aio("a"))
573573
nanotestn(stop_aio(list("a")))
574-
nanotestn(.promise(NULL, new.env()))
575-
nanotestn(.promise(new.env(), new.env()))
574+
nanotestn(.keep(NULL, new.env()))
575+
nanotestn(.keep(new.env(), new.env()))
576576

577577
pem <- "-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----"
578578
test_tls <- function(pem) {

0 commit comments

Comments
 (0)