384
384
# > < recvAio >
385
385
# > - $data for message data
386
386
aio $ data | > str()
387
- # > num [1:100000000] -0.842 1.729 -1.326 0.757 0.424 ...
387
+ # > num [1:100000000] 1.441 -2.63 -3.437 -0.364 -0.141 ...
388
388
```
389
389
390
390
As ` call_aio() ` is blocking and will wait for completion, an alternative
@@ -543,11 +543,11 @@ ncurl("https://httpbin.org/headers")
543
543
# > [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
544
544
# > [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
545
545
# > [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
546
- # > [76] 2d 36 33 31 31 33 35 63 34 2d 31 35 38 63 32 32 33 64 32 66 63 64 33 37 62
547
- # > [101] 33 31 37 62 34 34 62 33 35 22 0a 20 20 7d 0a 7d 0a
546
+ # > [76] 2d 36 33 31 31 62 39 34 31 2d 36 34 63 35 38 33 38 63 32 65 30 64 66 64 37
547
+ # > [101] 39 33 63 63 64 32 38 30 37 22 0a 20 20 7d 0a 7d 0a
548
548
# >
549
549
# > $data
550
- # > [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-631135c4-158c223d2fcd37b317b44b35 \"\n }\n}\n"
550
+ # > [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6311b941-64c5838c2e0dfd793ccd2807 \"\n }\n}\n"
551
551
```
552
552
553
553
For advanced use, supports additional HTTP methods such as POST or PUT.
@@ -566,13 +566,13 @@ res
566
566
567
567
call_aio(res )$ headers
568
568
# > $Date
569
- # > [1] "Thu, 01 Sep 2022 22:44:20 GMT"
569
+ # > [1] "Fri, 02 Sep 2022 08:05:22 GMT"
570
570
# >
571
571
# > $Server
572
572
# > [1] "gunicorn/19.9.0"
573
573
574
574
res $ data
575
- # > [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-631135c4-55622abd3b66c27e03b8a133 \"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"185.225.45.49 \", \n \"url\": \"http://httpbin.org/post\"\n}\n"
575
+ # > [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-6311b942-3e8b949a548bce0d1dc88ee7 \"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"213.86.169.34 \", \n \"url\": \"http://httpbin.org/post\"\n}\n"
576
576
```
577
577
578
578
In this respect, it may be used as a performant and lightweight method
@@ -615,10 +615,10 @@ s |> send('{"action": "subscribe", "symbols": "EURUSD"}')
615
615
# > [26] 73 79 6d 62 6f 6c 73 22 3a 20 22 45 55 52 55 53 44 22 7d 00
616
616
617
617
s | > recv(keep.raw = FALSE )
618
- # > [1] "{\"s\":\"EURUSD\",\"a\":0.99456 ,\"b\":0.99452 ,\"dc\":\"-0.9280 \",\"dd\":\"-0.0092 \",\"ppms\":false,\"t\":1662072262000 }"
618
+ # > [1] "{\"s\":\"EURUSD\",\"a\":0.9986 ,\"b\":0.99853 ,\"dc\":\"0.3425 \",\"dd\":\"0.0034 \",\"ppms\":false,\"t\":1662105923000 }"
619
619
620
620
s | > recv(keep.raw = FALSE )
621
- # > [1] "{\"s\":\"EURUSD\",\"a\":0.99455 ,\"b\":0.99453 ,\"dc\":\"-0.9291 \",\"dd\":\"-0.0092 \",\"ppms\":false,\"t\":1662072262000 }"
621
+ # > [1] "{\"s\":\"EURUSD\",\"a\":0.99854 ,\"b\":0.99852 ,\"dc\":\"0.3365 \",\"dd\":\"0.0034 \",\"ppms\":false,\"t\":1662105923000 }"
622
622
623
623
close(s )
624
624
```
0 commit comments