We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c01ab7e commit a37e6d1Copy full SHA for a37e6d1
DESCRIPTION
@@ -1,7 +1,7 @@
1
Package: nanonext
2
Type: Package
3
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
4
-Version: 1.2.1.9013
+Version: 1.2.1.9014
5
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
6
a socket library implementing 'Scalability Protocols', a reliable,
7
high-performance standard for common communications patterns including
NAMESPACE
@@ -47,8 +47,8 @@ export("%~>%")
47
export("opt<-")
48
export(.advance)
49
export(.context)
50
+export(.keep)
51
export(.mark)
-export(.promise)
52
export(.unresolved)
53
export(call_aio)
54
export(call_aio_)
@@ -89,6 +89,7 @@ export(request)
89
export(send)
90
export(send_aio)
91
export(serial_config)
92
+export(set_promise_context)
93
export(socket)
94
export(stat)
95
export(status_code)
NEWS.md
@@ -1,4 +1,4 @@
-# nanonext 1.2.1.9013 (development)
+# nanonext 1.2.1.9014 (development)
#### New Features
R/aio.R
@@ -371,8 +371,7 @@ as.promise.recvAio <- function(x) {
371
if (unresolved(x)) {
372
promise <- promises::then(
373
promises::promise(
374
- function(resolve, reject)
375
- .promise(x, environment())
+ function(resolve, reject) .keep(x, environment())
376
),
377
onFulfilled = function(value)
378
if (is_error_value(value)) stop(nng_error(value)) else value
@@ -397,7 +396,7 @@ as.promise.recvAio <- function(x) {
397
396
#'
398
is.promising.recvAio <- function(x) TRUE
399
400
-#' Create Promise
+#' Keep Promise
401
402
#' Internal package function.
403
@@ -412,4 +411,9 @@ is.promising.recvAio <- function(x) TRUE
412
411
#' @keywords internal
413
#' @export
414
415
-.promise <- function(x, ctx) .Call(rnng_create_promise, x, ctx)
+.keep <- function(x, ctx) .Call(rnng_set_promise_context, x, ctx)
+
416
+#' @rdname dot-keep
417
+#' @export
418
+#'
419
+set_promise_context <- .keep
R/ncurl.R
@@ -246,8 +246,7 @@ as.promise.ncurlAio <- function(x) {
246
247
248
249
250
251
252
253
if (value != 200L)
man/dot-promise.Rd renamed to man/dot-keep.Rd
src/init.c
@@ -129,7 +129,6 @@ static const R_CallMethodDef callMethods[] = {
129
{"rnng_aio_stop", (DL_FUNC) &rnng_aio_stop, 1},
130
{"rnng_clock", (DL_FUNC) &rnng_clock, 0},
131
{"rnng_close", (DL_FUNC) &rnng_close, 1},
132
- {"rnng_create_promise", (DL_FUNC) &rnng_create_promise, 2},
133
{"rnng_ctx_close", (DL_FUNC) &rnng_ctx_close, 1},
134
{"rnng_ctx_create", (DL_FUNC) &rnng_ctx_create, 1},
135
{"rnng_ctx_open", (DL_FUNC) &rnng_ctx_open, 1},
@@ -170,6 +169,7 @@ static const R_CallMethodDef callMethods[] = {
170
169
{"rnng_serial_config", (DL_FUNC) &rnng_serial_config, 4},
171
{"rnng_set_marker", (DL_FUNC) &rnng_set_marker, 1},
172
{"rnng_set_opt", (DL_FUNC) &rnng_set_opt, 3},
+ {"rnng_set_promise_context", (DL_FUNC) &rnng_set_promise_context, 2},
173
{"rnng_signal_thread_create", (DL_FUNC) &rnng_signal_thread_create, 2},
174
{"rnng_sleep", (DL_FUNC) &rnng_sleep, 1},
175
{"rnng_socket_lock", (DL_FUNC) &rnng_socket_lock, 2},
src/nanonext.h
@@ -259,7 +259,6 @@ SEXP rnng_aio_result(SEXP);
259
SEXP rnng_aio_stop(SEXP);
260
SEXP rnng_clock(void);
261
SEXP rnng_close(SEXP);
262
-SEXP rnng_create_promise(SEXP, SEXP);
263
SEXP rnng_ctx_close(SEXP);
264
SEXP rnng_ctx_create(SEXP);
265
SEXP rnng_ctx_open(SEXP);
@@ -301,6 +300,7 @@ SEXP rnng_send_aio(SEXP, SEXP, SEXP, SEXP, SEXP);
301
300
SEXP rnng_serial_config(SEXP, SEXP, SEXP, SEXP);
302
SEXP rnng_set_marker(SEXP);
303
SEXP rnng_set_opt(SEXP, SEXP, SEXP);
+SEXP rnng_set_promise_context(SEXP, SEXP);
304
SEXP rnng_signal_thread_create(SEXP, SEXP);
305
SEXP rnng_sleep(SEXP);
306
SEXP rnng_socket_lock(SEXP, SEXP);
src/sync.c
@@ -498,7 +498,7 @@ SEXP rnng_request(SEXP con, SEXP data, SEXP sendmode, SEXP recvmode, SEXP timeou
498
499
}
500
501
-SEXP rnng_create_promise(SEXP x, SEXP ctx) {
+SEXP rnng_set_promise_context(SEXP x, SEXP ctx) {
502
503
if (TYPEOF(x) != ENVSXP)
504
return R_NilValue;
tests/tests.R
@@ -211,7 +211,7 @@ nanotestp(p <- tryCatch(collect_pipe(r), error = function(e) NULL))
211
if (!is.null(p)) nanotest(is_nano(p))
212
nanotest(.mark())
213
nanotestaio(r <- send_aio(if (is_nano(p)) p else rep, "", timeout = 500))
214
-if (later) nanotestn(.promise(r, new.env()))
+if (later) nanotestn(.keep(r, new.env()))
215
nanotesterr(collect_pipe(r), "valid")
216
nanotest(req$recv(mode = 8L, block = 500)[4L] == 1L)
217
nanotest(!.mark(FALSE))
@@ -571,8 +571,8 @@ nanotesterr(collect_aio_(list("a")), "object is not an Aio or list of Aios")
571
nanotesterr(collect_aio(list(fakesock)), "object is not an Aio or list of Aios")
572
nanotestn(stop_aio("a"))
573
nanotestn(stop_aio(list("a")))
574
-nanotestn(.promise(NULL, new.env()))
575
-nanotestn(.promise(new.env(), new.env()))
+nanotestn(.keep(NULL, new.env()))
+nanotestn(.keep(new.env(), new.env()))
576
577
pem <- "-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----"
578
test_tls <- function(pem) {
0 commit comments