244244# > - $data for message data
245245# > - $raw for raw message
246246msg $ data
247- # > < unresolved: logi NA >
247+ # > ' unresolved' logi NA
248248```
249249
250250For a ‘sendAio’ object, the result is stored at ` $result ` .
@@ -290,7 +290,7 @@ Aio to resolve, as the example below demonstrates.
290290``` r
291291msg <- recv_aio(s2 )
292292
293- # unresolved() queries for resolution itself so no need to use it again within the while clause
293+ # unresolved() queries for resolution itself so no need to use it again within the while loop
294294while (unresolved(msg )) {
295295 # do stuff before checking resolution again
296296 send_aio(s1 , " resolved" )
369369# > < recvAio >
370370# > - $data for message data
371371aio $ data | > str()
372- # > num [1:100000000] 0.0464 1.2575 1.8635 0.9356 -0.9033 ...
372+ # > num [1:100000000] -1.195 0.322 -0.96 -0.25 -1.281 ...
373373```
374374
375375As ` call_aio() ` is blocking and will wait for completion, an alternative
@@ -404,37 +404,37 @@ an environment variable `NANONEXT_LOG`.
404404
405405``` r
406406logging(level = " info" )
407- # > 2022-03-09 18:36:44 [ log level ] set to: info
407+ # > 2022-03-09 19:58:51 [ log level ] set to: info
408408
409409pub <- socket(" pub" , listen = " inproc://nanobroadcast" )
410- # > 2022-03-09 18:36:44 [ sock open ] id: 9 | protocol: pub
411- # > 2022-03-09 18:36:44 [ list start ] sock: 9 | url: inproc://nanobroadcast
410+ # > 2022-03-09 19:58:51 [ sock open ] id: 9 | protocol: pub
411+ # > 2022-03-09 19:58:51 [ list start ] sock: 9 | url: inproc://nanobroadcast
412412sub <- socket(" sub" , dial = " inproc://nanobroadcast" )
413- # > 2022-03-09 18:36:44 [ sock open ] id: 10 | protocol: sub
414- # > 2022-03-09 18:36:44 [ dial start ] sock: 10 | url: inproc://nanobroadcast
413+ # > 2022-03-09 19:58:51 [ sock open ] id: 10 | protocol: sub
414+ # > 2022-03-09 19:58:51 [ dial start ] sock: 10 | url: inproc://nanobroadcast
415415
416416sub | > subscribe(topic = " examples" )
417- # > 2022-03-09 18:36:44 [ subscribe ] sock: 10 | topic: examples
417+ # > 2022-03-09 19:58:51 [ subscribe ] sock: 10 | topic: examples
418418pub | > send(c(" examples" , " this is an example" ), mode = " raw" , echo = FALSE )
419419sub | > recv(mode = " character" , keep.raw = FALSE )
420420# > [1] "examples" "this is an example"
421421
422422pub | > send(c(" other" , " this other topic will not be received" ), mode = " raw" , echo = FALSE )
423423sub | > recv(mode = " character" , keep.raw = FALSE )
424- # > 2022-03-09 18:36:44 [ 8 ] Try again
424+ # > 2022-03-09 19:58:51 [ 8 ] Try again
425425
426426# specify NULL to subscribe to ALL topics
427427sub | > subscribe(topic = NULL )
428- # > 2022-03-09 18:36:44 [ subscribe ] sock: 10 | topic: ALL
428+ # > 2022-03-09 19:58:51 [ subscribe ] sock: 10 | topic: ALL
429429pub | > send(c(" newTopic" , " this is a new topic" ), mode = " raw" , echo = FALSE )
430430sub | > recv(" character" , keep.raw = FALSE )
431431# > [1] "newTopic" "this is a new topic"
432432
433433sub | > unsubscribe(topic = NULL )
434- # > 2022-03-09 18:36:44 [ unsubscribe ] sock: 10 | topic: ALL
434+ # > 2022-03-09 19:58:51 [ unsubscribe ] sock: 10 | topic: ALL
435435pub | > send(c(" newTopic" , " this topic will now not be received" ), mode = " raw" , echo = FALSE )
436436sub | > recv(" character" , keep.raw = FALSE )
437- # > 2022-03-09 18:36:44 [ 8 ] Try again
437+ # > 2022-03-09 19:58:51 [ 8 ] Try again
438438
439439# however the topics explicitly subscribed to are still received
440440pub | > send(c(" examples" , " this example will still be received" ), mode = " raw" , echo = FALSE )
@@ -443,7 +443,7 @@ sub |> recv(mode = "character", keep.raw = FALSE)
443443
444444# set logging level back to the default of errors only
445445logging(level = " error" )
446- # > 2022-03-09 18:36:44 [ log level ] set to: error
446+ # > 2022-03-09 19:58:51 [ log level ] set to: error
447447
448448close(pub )
449449close(sub )
@@ -489,12 +489,12 @@ res2 |> recv(keep.raw = FALSE)
489489aio1 $ data
490490# > [1] "res1"
491491aio2 $ data
492- # > < unresolved: logi NA >
492+ # > ' unresolved' logi NA
493493
494494# after the survey expires, the second resolves into a timeout error
495495Sys.sleep(0.5 )
496496aio2 $ data
497- # > 2022-03-09 18:36:44 [ 5 ] Timed out
497+ # > 2022-03-09 19:58:52 [ 5 ] Timed out
498498# > 'errorValue' int 5
499499
500500close(sur )
@@ -520,11 +520,11 @@ ncurl("http://httpbin.org/headers")
520520# > [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
521521# > [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
522522# > [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
523- # > [76] 2d 36 32 32 38 66 33 62 64 2d 31 66 33 39 30 32 33 35 37 65 61 31 38 34 61
524- # > [101] 35 33 32 30 62 30 38 64 38 22 0a 20 20 7d 0a 7d 0a
523+ # > [76] 2d 36 32 32 39 30 36 66 63 2d 31 63 66 62 33 33 61 30 31 62 30 37 65 30 61
524+ # > [101] 38 33 30 66 37 39 63 39 39 22 0a 20 20 7d 0a 7d 0a
525525# >
526526# > $data
527- # > [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6228f3bd-1f3902357ea184a5320b08d8 \"\n }\n}\n"
527+ # > [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-622906fc-1cfb33a01b07e0a830f79c99 \"\n }\n}\n"
528528```
529529
530530For advanced use, supports additional HTTP methods such as POST or PUT.
0 commit comments