369369# > < recvAio >
370370# > - $data for message data
371371aio $ data | > str()
372- # > num [1:100000000] -1.195 0.322 -0.96 -0.25 -1.281 ...
372+ # > num [1:100000000] -2.0235 -1.8686 0.7019 0.0643 -1.2512 ...
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 19:58:51 [ log level ] set to: info
407+ # > 2022-03-10 07:36:02 [ log level ] set to: info
408408
409409pub <- socket(" pub" , listen = " 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
410+ # > 2022-03-10 07:36:02 [ sock open ] id: 9 | protocol: pub
411+ # > 2022-03-10 07:36:02 [ list start ] sock: 9 | url: inproc://nanobroadcast
412412sub <- socket(" sub" , dial = " 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
413+ # > 2022-03-10 07:36:02 [ sock open ] id: 10 | protocol: sub
414+ # > 2022-03-10 07:36:02 [ dial start ] sock: 10 | url: inproc://nanobroadcast
415415
416416sub | > subscribe(topic = " examples" )
417- # > 2022-03-09 19:58:51 [ subscribe ] sock: 10 | topic: examples
417+ # > 2022-03-10 07:36:02 [ 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 19:58:51 [ 8 ] Try again
424+ # > 2022-03-10 07:36:02 [ 8 ] Try again
425425
426426# specify NULL to subscribe to ALL topics
427427sub | > subscribe(topic = NULL )
428- # > 2022-03-09 19:58:51 [ subscribe ] sock: 10 | topic: ALL
428+ # > 2022-03-10 07:36:02 [ 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 19:58:51 [ unsubscribe ] sock: 10 | topic: ALL
434+ # > 2022-03-10 07:36:02 [ 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 19:58:51 [ 8 ] Try again
437+ # > 2022-03-10 07:36:02 [ 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 19:58:51 [ log level ] set to: error
446+ # > 2022-03-10 07:36:02 [ log level ] set to: error
447447
448448close(pub )
449449close(sub )
@@ -494,7 +494,7 @@ aio2$data
494494# after the survey expires, the second resolves into a timeout error
495495Sys.sleep(0.5 )
496496aio2 $ data
497- # > 2022-03-09 19:58:52 [ 5 ] Timed out
497+ # > 2022-03-10 07:36:03 [ 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 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
523+ # > [76] 2d 36 32 32 39 61 61 36 33 2d 33 34 39 63 37 35 30 30 31 65 65 39 36 39 64
524+ # > [101] 32 31 30 37 39 62 31 64 66 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-622906fc-1cfb33a01b07e0a830f79c99 \"\n }\n}\n"
527+ # > [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6229aa63-349c75001ee969d21079b1df \"\n }\n}\n"
528528```
529529
530530For advanced use, supports additional HTTP methods such as POST or PUT.
0 commit comments