Skip to content

Commit 043b827

Browse files
committed
Adds synchronisation primitives to package description
1 parent 893d157 commit 043b827

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

DESCRIPTION

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
77
implementing a cross-platform standard for messaging and communications.
88
Serves as a concurrency framework for building distributed applications,
99
utilising 'aio' objects which resolve automatically upon completion of
10-
asynchronous operations.
10+
asynchronous operations. Provides synchronisation primitives which allow R
11+
to wait upon socket events or message receives being signalled by other
12+
underlying threads.
1113
Authors@R:
1214
c(person(given = "Charlie",
1315
family = "Gao",

R/nanonext-package.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
#' cross-platform standard for messaging and communications. Serves as a
2424
#' concurrency framework for building distributed applications, utilising
2525
#' 'aio' objects which resolve automatically upon completion of asynchronous
26-
#' operations.
26+
#' operations. Provides synchronisation primitives which allow R to wait
27+
#' upon socket events or message receives being signalled by other
28+
#' underlying threads.
2729
#'
2830
#' @section Usage notes:
2931
#'

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ knitr::opts_chunk$set(
2222
[![codecov](https://codecov.io/gh/shikokuchuo/nanonext/branch/main/graph/badge.svg)](https://app.codecov.io/gh/shikokuchuo/nanonext)
2323
<!-- badges: end -->
2424

25-
R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is a socket library providing high-performance scalability protocols, implementing a cross-platform standard for messaging and communications. Serves as a concurrency framework for building distributed applications, utilising 'aio' objects which resolve automatically upon completion of asynchronous operations.
25+
R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is a socket library providing high-performance scalability protocols, implementing a cross-platform standard for messaging and communications. Serves as a concurrency framework for building distributed applications, utilising 'aio' objects which resolve automatically upon completion of asynchronous operations. Provides synchronisation primitives which allow R to wait upon socket events or message receives being signalled by other underlying threads.
2626

2727
Designed for performance and reliability, the NNG library is written in C and {nanonext} is a lightweight zero-dependency wrapper. Provides the interface for code and processes to communicate with each other - receive data generated in Python, perform analysis in R, and send results to a C++ program – all on the same computer or on networks spanning the globe.
2828

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ socket library providing high-performance scalability protocols,
1818
implementing a cross-platform standard for messaging and communications.
1919
Serves as a concurrency framework for building distributed applications,
2020
utilising ‘aio’ objects which resolve automatically upon completion of
21-
asynchronous operations.
21+
asynchronous operations. Provides synchronisation primitives which allow
22+
R to wait upon socket events or message receives being signalled by
23+
other underlying threads.
2224

2325
Designed for performance and reliability, the NNG library is written in
2426
C and {nanonext} is a lightweight zero-dependency wrapper. Provides the
@@ -367,7 +369,7 @@ aio
367369
#> < recvAio >
368370
#> - $data for message data
369371
aio$data |> str()
370-
#> num [1:100000000] -1.959 0.507 0.83 -0.458 0.844 ...
372+
#> num [1:100000000] -0.9135 -0.0486 -2.2213 -0.247 0.6944 ...
371373
```
372374

373375
As `call_aio()` is blocking and will wait for completion, an alternative
@@ -651,11 +653,11 @@ ncurl("https://httpbin.org/headers")
651653
#> [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
652654
#> [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
653655
#> [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
654-
#> [76] 2d 36 34 31 64 34 64 36 63 2d 34 65 62 61 38 36 65 66 37 62 34 35 64 37 65
655-
#> [101] 36 36 30 30 65 33 62 31 30 22 0a 20 20 7d 0a 7d 0a
656+
#> [76] 2d 36 34 31 64 39 34 35 37 2d 36 63 64 61 33 38 30 34 30 62 35 37 65 66 62
657+
#> [101] 62 35 39 31 37 38 65 39 30 22 0a 20 20 7d 0a 7d 0a
656658
#>
657659
#> $data
658-
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-641d4d6c-4eba86ef7b45d7e6600e3b10\"\n }\n}\n"
660+
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-641d9457-6cda38040b57efbb59178e90\"\n }\n}\n"
659661
```
660662

661663
For advanced use, supports additional HTTP methods such as POST or PUT.
@@ -676,13 +678,13 @@ res
676678

677679
call_aio(res)$headers
678680
#> $Date
679-
#> [1] "Fri, 24 Mar 2023 07:12:44 GMT"
681+
#> [1] "Fri, 24 Mar 2023 12:15:20 GMT"
680682
#>
681683
#> $Server
682684
#> [1] "gunicorn/19.9.0"
683685

684686
res$data
685-
#> [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-641d4d6c-4ff4b2e17fd2884123ae75b1\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"131.111.5.14\", \n \"url\": \"http://httpbin.org/post\"\n}\n"
687+
#> [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-641d9458-5f205e8b7bfe624f5f89a231\"\n }, \n \"json\": {\n \"key\": \"value\"\n }, \n \"origin\": \"131.111.5.14\", \n \"url\": \"http://httpbin.org/post\"\n}\n"
686688
```
687689

688690
In this respect, it may be used as a performant and lightweight method
@@ -708,7 +710,7 @@ transact(sess)
708710
#>
709711
#> $headers
710712
#> $headers$date
711-
#> [1] "Fri, 24 Mar 2023 07:12:45 GMT"
713+
#> [1] "Fri, 24 Mar 2023 12:15:20 GMT"
712714
#>
713715
#>
714716
#> $raw
@@ -719,14 +721,14 @@ transact(sess)
719721
#> [101] 69 6f 6e 2f 6a 73 6f 6e 22 2c 20 0a 20 20 20 20 22 48 6f 73 74 22 3a 20 22
720722
#> [126] 68 74 74 70 62 69 6e 2e 6f 72 67 22 2c 20 0a 20 20 20 20 22 58 2d 41 6d 7a
721723
#> [151] 6e 2d 54 72 61 63 65 2d 49 64 22 3a 20 22 52 6f 6f 74 3d 31 2d 36 34 31 64
722-
#> [176] 34 64 36 64 2d 37 33 32 39 61 30 35 61 36 65 34 35 38 31 33 37 36 35 36 36
723-
#> [201] 37 38 37 34 22 0a 20 20 7d 2c 20 0a 20 20 22 6f 72 69 67 69 6e 22 3a 20 22
724-
#> [226] 31 38 35 2e 32 32 35 2e 34 35 2e 34 39 22 2c 20 0a 20 20 22 75 72 6c 22 3a
725-
#> [251] 20 22 68 74 74 70 73 3a 2f 2f 68 74 74 70 62 69 6e 2e 6f 72 67 2f 67 65 74
726-
#> [276] 22 0a 7d 0a
724+
#> [176] 39 34 35 38 2d 37 63 35 38 34 30 31 34 37 63 33 38 30 64 61 63 36 30 32 34
725+
#> [201] 36 39 62 63 22 0a 20 20 7d 2c 20 0a 20 20 22 6f 72 69 67 69 6e 22 3a 20 22
726+
#> [226] 37 39 2e 31 37 33 2e 31 32 39 2e 32 22 2c 20 0a 20 20 22 75 72 6c 22 3a 20
727+
#> [251] 22 68 74 74 70 73 3a 2f 2f 68 74 74 70 62 69 6e 2e 6f 72 67 2f 67 65 74 22
728+
#> [276] 0a 7d 0a
727729
#>
728730
#> $data
729-
#> [1] "{\n \"args\": {}, \n \"headers\": {\n \"Authorization\": \"Bearer APIKEY\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-641d4d6d-7329a05a6e45813765667874\"\n }, \n \"origin\": \"131.111.5.14\", \n \"url\": \"https://httpbin.org/get\"\n}\n"
731+
#> [1] "{\n \"args\": {}, \n \"headers\": {\n \"Authorization\": \"Bearer APIKEY\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-641d9458-7c5840147c380dac602469bc\"\n }, \n \"origin\": \"131.111.5.14\", \n \"url\": \"https://httpbin.org/get\"\n}\n"
730732
```
731733

732734
[« Back to ToC](#table-of-contents)

man/nanonext-package.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)