Skip to content

Commit 5f5e4bb

Browse files
committed
CRAN release 0.7.0
1 parent 3fd86a7 commit 5f5e4bb

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
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.9700
4+
Version: 0.7.0
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# nanonext 0.6.0.9700 (0.7.0 release candidate)
1+
# nanonext 0.7.0
22

3-
*nanonext 0.7 has focused on optimising the API after completing feature additions and performance enhancements; the API is again expected to remain stable after these changes*
3+
*nanonext 0.7 implements API optimisations after recent enhancements; the API is again intended to remain stable after these changes*
44

55
#### New Features
66

@@ -24,7 +24,7 @@
2424

2525
*Other changes:*
2626

27-
* Integer send/recv (and setopt) arguments implemented in 0.5.3 are now documented and considered part of the API. This is a performance feature that skips matching the character argument value.
27+
* Integer `send()`/`recv()` arguments for 'mode' and `setopt()` arguments for 'type' implemented in 0.5.3 are now documented and considered part of the API. This is a performance feature that skips matching the character argument value.
2828
* Fixes bug introduced in 0.6.0 where Aios returning 'errorValues' are not cached with the class, returning only integer values when accessed subsequently.
2929
* Fixes potential crash when `base64dec()` encounters invalid input data. Error messages have been revised to be more accurate.
3030
* Fixes the `$` method for 'recvAio' objects for when the object has been stopped using `stop_aio()`.

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] 1.5473 -1.808 0.0313 -0.8537 -2.4185 ...
368+
#> num [1:100000000] -0.994 -1.507 -0.857 -0.88 -0.294 ...
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 35 34 63 38 31 2d 34 63 38 33 63 36 37 64 37 38 36 35 65 66 32
530-
#> [101] 35 32 61 65 38 61 35 38 30 22 0a 20 20 7d 0a 7d 0a
529+
#> [76] 2d 36 33 36 38 64 33 39 34 2d 36 30 39 61 32 32 61 35 33 36 35 63 31 31 62
530+
#> [101] 36 34 38 35 30 65 64 34 65 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-63654c81-4c83c67d7865ef252ae8a580\"\n }\n}\n"
533+
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6368d394-609a22a5365c11b64850ed4e\"\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] "Fri, 04 Nov 2022 17:31:45 GMT"
554+
#> [1] "Mon, 07 Nov 2022 09:44:52 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-63654c81-75d995a77f18b2cf33ed5448\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"213.86.169.34\", \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-6368d394-3a93bcc6609ccb4b6f98b635\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"79.173.129.2\", \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.99199,\"b\":0.99192,\"dc\":\"1.7208\",\"dd\":\"0.0171\",\"ppms\":false,\"t\":1667583106000}"
602+
#> [1] "{\"s\":\"EURUSD\",\"a\":0.99892,\"b\":0.99885,\"dc\":\"0.6117\",\"dd\":\"0.0061\",\"ppms\":false,\"t\":1667814293000}"
603603

604604
s |> recv()
605-
#> [1] "{\"s\":\"EURUSD\",\"a\":0.99198,\"b\":0.99196,\"dd\":\"0.0171\",\"dc\":\"1.7198\",\"ppms\":false,\"t\":1667583106000}"
605+
#> [1] "{\"s\":\"EURUSD\",\"a\":0.99891,\"b\":0.99884,\"dc\":\"0.6107\",\"dd\":\"0.0061\",\"ppms\":false,\"t\":1667814293000}"
606606

607607
close(s)
608608
```

src/aio.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,38 +135,38 @@ static void haio_finalizer(SEXP xptr) {
135135

136136
}
137137

138-
static SEXP mk_error_saio(const int xc, SEXP env) {
138+
static SEXP mk_error_saio(const int xc, SEXP clo) {
139139

140140
SEXP err = PROTECT(Rf_ScalarInteger(xc));
141141
SET_ATTRIB(err, nano_error);
142142
SET_OBJECT(err, 1);
143-
Rf_defineVar(nano_ResultSymbol, err, ENCLOS(env));
143+
Rf_defineVar(nano_ResultSymbol, err, clo);
144144
UNPROTECT(1);
145145
return err;
146146

147147
}
148148

149-
static SEXP mk_error_raio(const int xc, SEXP env) {
149+
static SEXP mk_error_raio(const int xc, SEXP clo) {
150150

151151
SEXP err = PROTECT(Rf_ScalarInteger(xc));
152152
SET_ATTRIB(err, nano_error);
153153
SET_OBJECT(err, 1);
154-
Rf_defineVar(nano_RawSymbol, err, ENCLOS(env));
155-
Rf_defineVar(nano_DataSymbol, err, ENCLOS(env));
154+
Rf_defineVar(nano_RawSymbol, err, clo);
155+
Rf_defineVar(nano_DataSymbol, err, clo);
156156
UNPROTECT(1);
157157
return err;
158158

159159
}
160160

161-
static SEXP mk_error_haio(const int xc, SEXP env) {
161+
static SEXP mk_error_haio(const int xc, SEXP clo) {
162162

163163
SEXP err = PROTECT(Rf_ScalarInteger(xc));
164164
SET_ATTRIB(err, nano_error);
165165
SET_OBJECT(err, 1);
166-
Rf_defineVar(nano_StatusSymbol, err, ENCLOS(env));
167-
Rf_defineVar(nano_IdSymbol, err, ENCLOS(env));
168-
Rf_defineVar(nano_RawSymbol, err, ENCLOS(env));
169-
Rf_defineVar(nano_ProtocolSymbol, err, ENCLOS(env));
166+
Rf_defineVar(nano_StatusSymbol, err, clo);
167+
Rf_defineVar(nano_IdSymbol, err, clo);
168+
Rf_defineVar(nano_RawSymbol, err, clo);
169+
Rf_defineVar(nano_ProtocolSymbol, err, clo);
170170
UNPROTECT(1);
171171
return err;
172172

@@ -205,7 +205,7 @@ SEXP rnng_aio_result(SEXP env) {
205205
return nano_unresolved;
206206

207207
if (aiop->result)
208-
return mk_error_saio(aiop->result, env);
208+
return mk_error_saio(aiop->result, ENCLOS(env));
209209

210210
Rf_defineVar(nano_ResultSymbol, nano_success, ENCLOS(env));
211211
return nano_success;
@@ -230,7 +230,7 @@ SEXP rnng_aio_get_msgraw(SEXP env) {
230230
return nano_unresolved;
231231

232232
if (raio->result)
233-
return mk_error_raio(raio->result, env);
233+
return mk_error_raio(raio->result, ENCLOS(env));
234234

235235
SEXP out;
236236
const int mod = -raio->mode, kpr = 1;
@@ -274,7 +274,7 @@ SEXP rnng_aio_get_msgdata(SEXP env) {
274274
return nano_unresolved;
275275

276276
if (raio->result)
277-
return mk_error_raio(raio->result, env);
277+
return mk_error_raio(raio->result, ENCLOS(env));
278278

279279
SEXP out;
280280
const int kpr = raio->mode > 0 ? 0 : 1, mod = kpr ? -raio->mode : raio->mode;
@@ -810,7 +810,7 @@ SEXP rnng_aio_http(SEXP env, SEXP response, SEXP which) {
810810
return nano_unresolved;
811811

812812
if (haio->result)
813-
return mk_error_haio(haio->result, env);
813+
return mk_error_haio(haio->result, ENCLOS(env));
814814

815815
void *dat;
816816
size_t sz;

0 commit comments

Comments
 (0)