Skip to content

Commit 913b9b8

Browse files
committed
RC2; do not waste time removing aio reference after access
1 parent 324999a commit 913b9b8

File tree

5 files changed

+10
-21
lines changed

5 files changed

+10
-21
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: 0.6.0.9500
4+
Version: 0.6.0.9600
55
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
66
a socket library providing high-performance scalability protocols,
77
implementing a cross-platform standard for messaging and communications.

NEWS.md

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

33
#### New Features
44

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ aio
365365
#> < recvAio >
366366
#> - $data for message data
367367
aio$data |> str()
368-
#> num [1:100000000] -0.582 0.51 1.779 -0.16 -0.073 ...
368+
#> num [1:100000000] 0.612 -0.988 0.695 1.556 -0.303 ...
369369
```
370370

371371
As `call_aio()` is blocking and will wait for completion, an alternative
@@ -526,11 +526,11 @@ ncurl("https://httpbin.org/headers")
526526
#> [1] 7b 0a 20 20 22 68 65 61 64 65 72 73 22 3a 20 7b 0a 20 20 20 20 22 48 6f 73
527527
#> [26] 74 22 3a 20 22 68 74 74 70 62 69 6e 2e 6f 72 67 22 2c 20 0a 20 20 20 20 22
528528
#> [51] 58 2d 41 6d 7a 6e 2d 54 72 61 63 65 2d 49 64 22 3a 20 22 52 6f 6f 74 3d 31
529-
#> [76] 2d 36 33 36 32 37 33 35 62 2d 30 33 61 32 38 36 38 64 35 62 33 32 61 63 32
530-
#> [101] 64 32 38 34 34 65 62 37 62 22 0a 20 20 7d 0a 7d 0a
529+
#> [76] 2d 36 33 36 32 62 66 61 36 2d 32 35 65 63 61 62 39 38 37 61 33 66 62 66 36
530+
#> [101] 61 30 63 63 33 63 32 36 64 22 0a 20 20 7d 0a 7d 0a
531531
#>
532532
#> $data
533-
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6362735b-03a2868d5b32ac2d2844eb7b\"\n }\n}\n"
533+
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6362bfa6-25ecab987a3fbf6a0cc3c26d\"\n }\n}\n"
534534
```
535535

536536
For advanced use, supports additional HTTP methods such as POST or PUT.
@@ -551,13 +551,13 @@ res
551551

552552
call_aio(res)$headers
553553
#> $Date
554-
#> [1] "Wed, 02 Nov 2022 13:40:43 GMT"
554+
#> [1] "Wed, 02 Nov 2022 19:06:14 GMT"
555555
#>
556556
#> $Server
557557
#> [1] "gunicorn/19.9.0"
558558

559559
res$data
560-
#> [1] "{\n \"args\": {}, \n \"data\": \"{\\\"key\\\": \\\"value\\\"}\", \n \"files\": {}, \n \"form\": {}, \n \"headers\": {\n \"Authorization\": \"Bearer APIKEY\", \n \"Content-Length\": \"16\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6362735b-172dc6bd4b3733d447616ba0\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"79.173.129.2\", \n \"url\": \"http://httpbin.org/post\"\n}\n"
560+
#> [1] "{\n \"args\": {}, \n \"data\": \"{\\\"key\\\": \\\"value\\\"}\", \n \"files\": {}, \n \"form\": {}, \n \"headers\": {\n \"Authorization\": \"Bearer APIKEY\", \n \"Content-Length\": \"16\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6362bfa6-4df434e66991ffe84e12d0e7\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"185.225.45.49\", \n \"url\": \"http://httpbin.org/post\"\n}\n"
561561
```
562562

563563
In this respect, it may be used as a performant and lightweight method
@@ -599,10 +599,10 @@ s |> send('{"action": "subscribe", "symbols": "EURUSD"}')
599599
#> [1] 0
600600

601601
s |> recv()
602-
#> [1] "{\"s\":\"EURUSD\",\"a\":0.9895,\"b\":0.98948,\"dc\":\"0.1809\",\"dd\":\"0.0018\",\"ppms\":false,\"t\":1667396233000}"
602+
#> [1] "{\"s\":\"EURUSD\",\"a\":0.98849,\"b\":0.98843,\"dc\":\"0.0789\",\"dd\":\"0.0008\",\"ppms\":false,\"t\":1667415975000}"
603603

604604
s |> recv()
605-
#> [1] "{\"s\":\"EURUSD\",\"a\":0.98949,\"b\":0.98947,\"dc\":\"0.1799\",\"dd\":\"0.0018\",\"ppms\":false,\"t\":1667396233000}"
605+
#> [1] "{\"s\":\"EURUSD\",\"a\":0.98846,\"b\":0.98839,\"dc\":\"0.0759\",\"dd\":\"0.0008\",\"ppms\":false,\"t\":1667415975000}"
606606

607607
close(s)
608608
```

src/aio.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ SEXP rnng_aio_result(SEXP env) {
203203
if (nng_aio_busy(aiop->aio))
204204
return nano_unresolved;
205205

206-
Rf_defineVar(nano_AioSymbol, R_NilValue, env);
207-
208206
if (aiop->result)
209207
return mk_error_saio(aiop->result, env);
210208

@@ -230,8 +228,6 @@ SEXP rnng_aio_get_msgraw(SEXP env) {
230228
if (nng_aio_busy(raio->aio))
231229
return nano_unresolved;
232230

233-
Rf_defineVar(nano_AioSymbol, R_NilValue, env);
234-
235231
if (raio->result)
236232
return mk_error_raio(raio->result, env);
237233

@@ -276,8 +272,6 @@ SEXP rnng_aio_get_msgdata(SEXP env) {
276272
if (nng_aio_busy(raio->aio))
277273
return nano_unresolved;
278274

279-
Rf_defineVar(nano_AioSymbol, R_NilValue, env);
280-
281275
if (raio->result)
282276
return mk_error_raio(raio->result, env);
283277

@@ -807,8 +801,6 @@ SEXP rnng_aio_http(SEXP env, SEXP response, SEXP which) {
807801
if (nng_aio_busy(haio->aio))
808802
return nano_unresolved;
809803

810-
Rf_defineVar(nano_AioSymbol, R_NilValue, env);
811-
812804
if (haio->result)
813805
return mk_error_haio(haio->result, env);
814806

tests/tests.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ nanotestz(n1$send(c(1L, 0L, 0L), mode = "r"))
6868
nanotest(is.list(n$recv("int", keep.raw = TRUE)))
6969
saio <- n$send_aio(data.frame(), timeout = 500)
7070
saio
71-
nanotestnn(saio[["aio"]])
7271
nanotest(is_aio(call_aio(saio)))
73-
nanotestn(saio[["aio"]])
7472
nanotest(!is_nano(saio))
7573
nanotest(is.integer(saio$result))
7674
nanotesterr(n$send("wrong mode", mode = "none"), "mode")
@@ -86,7 +84,6 @@ nanotest(is_aio(saio))
8684
nanotest(is.logical(unresolved(saio)))
8785
nanotestnn(raio$raw)
8886
nanotest(identical(unserialize(call_aio(raio)$raw), raio$data))
89-
nanotestn(raio[["aio"]])
9087

9188
msg <- n1$recv_aio(mode = "numer", keep.raw = TRUE, timeout = 500)
9289
nanotestn(stop_aio(msg))

0 commit comments

Comments
 (0)