Skip to content

Commit f47fd3d

Browse files
committed
CRAN 0.2.0 release
1 parent ad32fdd commit f47fd3d

File tree

7 files changed

+67
-41
lines changed

7 files changed

+67
-41
lines changed

DESCRIPTION

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Package: nanonext
22
Type: Package
33
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
4-
Version: 0.1.0.9000
4+
Version: 0.2.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,
7-
implementing a cross-platform standard for messaging and communications.
7+
implementing a cross-platform standard for messaging and communications.
88
Serves as a concurrency framework that can be used for building distributed
9-
systems.
9+
applications.
1010
Authors@R:
1111
c(person(given = "Charlie",
1212
family = "Gao",
@@ -21,7 +21,8 @@ License: GPL (>= 3)
2121
BugReports: https://github.com/shikokuchuo/nanonext/issues
2222
URL: https://shikokuchuo.net/nanonext/, https://github.com/shikokuchuo/nanonext/
2323
Encoding: UTF-8
24-
SystemRequirements: either 'libnng' (deb: libnng-dev, rpm: nng-devel) or 'cmake' (to compile from source)
24+
SystemRequirements: either 'libnng' (deb: libnng-dev, rpm: nng-devel)
25+
or 'cmake' (to compile from source)
2526
Depends:
2627
R (>= 2.4)
2728
RoxygenNote: 7.1.2

NEWS.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1-
# nanonext 0.1.0.9000 (under development)
1+
# nanonext 0.2.0
22

33
#### New Features
44

55
* Implements full async I/O capabilities
66
+ `send_aio()` and `recv_aio()` now return Aio objects, for which the results may be called using `call_aio()`.
7-
* New `request()` and `reply()` functions implement the full logic of an RPC client/server.
7+
* New `request()` and `reply()` functions implement the full logic of an RPC client/server, allowing processes to run concurrently on the client and server.
88
+ Designed to be run in separate processes, the reply server will await data and apply a function before returning a result.
99
+ The request client performs an async request to the server and returns immediately with an Aio.
10-
+ This allows processes to run concurrently on the client and server.
1110
* New `ncurl()` minimalistic http(s) client.
11+
* New `nng_timer()` utility as a demonstration of NNG's multithreading capabilities.
1212
* Allows setting the environment variable 'NANONEXT_TLS' prior to package installation
1313
+ Enables TLS where the system NNG library has been built with TLS support (using Mbed TLS).
14-
* New `nng_timer()` utility as a demonstration of NNG's multithreading capabilities.
1514

1615
#### Updates
1716

1817
* Dialer/listener starts and close operations no longer print a message to stderr when successful for less verbosity by default.
19-
+ The state of respective objects can always be queried using `$state`
2018
* All send and receive functions, e.g. `send()`/`recv()`, gain a revised 'mode' argument.
2119
+ This now permits R serialization as an option, consolidating the functionality of the '_vec' series of functions.
2220
* Functions 'send_vec' and 'recv_vec' are deprecated and will be removed in a future release.

R/nanonext-package.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
#' R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is a socket
66
#' library providing high-performance scalability protocols, implementing a
77
#' cross-platform standard for messaging and communications. Serves as a
8-
#' concurrency framework that can be used for building distributed systems.
8+
#' concurrency framework that can be used for building distributed
9+
#' applications.
910
#'
1011
#' @section Usage notes:
1112
#'
@@ -116,7 +117,6 @@
116117
#' @importFrom utils .DollarNames
117118
#' @useDynLib nanonext, .registration = TRUE
118119
#'
119-
#' @aliases nanonext
120120
#' @docType package
121121
#' @name nanonext-package
122122
#'

README.Rmd

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,25 @@ knitr::opts_chunk$set(
2121
[![R-CMD-check](https://github.com/shikokuchuo/nanonext/workflows/R-CMD-check/badge.svg)](https://github.com/shikokuchuo/nanonext/actions)
2222
<!-- badges: end -->
2323

24-
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 that can be used for building distributed systems.
24+
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 that can be used for building distributed applications.
2525

26-
Designed for performance and reliability, the NNG library is written in C and {nanonext} is a lightweight wrapper depending on no other packages. Supported transports include inproc (intra-process), IPC (inter-process), TCP/IP (IPv4 or IPv6), and WebSocket. The inproc transport uses zero-copy where possible for a much faster solution than alternatives.
26+
Designed for performance and reliability, the NNG library is written in C and {nanonext} is a lightweight wrapper depending on no other packages. 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.
2727

28-
Can be used for sending data across networks, but equally as an 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.
28+
Implemented scalability protocols:
29+
30+
- Bus (routing)
31+
- Pair (two-way radio)
32+
- Pipeline (one-way pipe)
33+
- Publisher/Subscriber (topics & broadcast)
34+
- Request/Reply (I ask, you answer)
35+
- Survey (everyone votes)
36+
37+
Implemented transports:
38+
39+
- inproc (intra-process)
40+
- IPC (inter-process)
41+
- TCP/IP (IPv4 or IPv6)
42+
- WebSocket
2943

3044
### Table of Contents
3145

@@ -61,7 +75,8 @@ install.packages("nanonext", repos = "https://shikokuchuo.r-universe.dev")
6175

6276
The primary object in the object-oriented interface is the nano object. Use `nano()` to create a nano object which encapsulates a Socket and Dialer/Listener. Methods such as `$send()` or `$recv()` can then be accessed directly from the object.
6377

64-
*Example using Request/Reply (REQ/REP) protocol with inproc transport:*
78+
*Example using Request/Reply (REQ/REP) protocol with inproc transport:* <br />
79+
(The inproc transport uses zero-copy where possible for a much faster solution than alternatives)
6580

6681
Create nano objects:
6782

@@ -113,7 +128,7 @@ recv(socket2)
113128

114129
### Cross-language Exchange
115130

116-
{nanonext} provides a fast and reliable data interface between different programming languages where NNG has a binding, including C, C++, Python, Go, Rust etc.
131+
{nanonext} provides a fast and reliable data interface between different programming languages where NNG has a binding, including C, C++, Java, Python, Go, Rust etc.
117132

118133
The following example demonstrates the exchange of numerical data between R and Python (NumPy), two of the most commonly-used languages for data science and machine learning.
119134

@@ -181,7 +196,7 @@ res$result
181196
182197
```
183198

184-
For a 'recvAio' object, calling the message causes it to be stored in the AIO as `$raw` and/or `$data` as the case may be.
199+
For a 'recvAio' object, calling the message causes it to be stored in the AIO as `$raw` (if kept) and `$data`.
185200

186201
```{r async3}
187202
@@ -212,7 +227,7 @@ close(s2)
212227

213228
Can be used to perform computationally-expensive calculations or I/O-bound operations such as writing large amounts of data to disk in a separate 'server' process running concurrently.
214229

215-
Server process: `reply()` will wait for a message and apply a function, in this case `rnorm()`, before sending back the result.
230+
Server process: `reply()` will wait for a message and apply a function, in this case `rnorm()`, before sending back the result
216231

217232
```{r rpcserver, eval=FALSE}
218233

README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,30 @@ R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is a
1616
socket library providing high-performance scalability protocols,
1717
implementing a cross-platform standard for messaging and communications.
1818
Serves as a concurrency framework that can be used for building
19-
distributed systems.
19+
distributed applications.
2020

2121
Designed for performance and reliability, the NNG library is written in
2222
C and {nanonext} is a lightweight wrapper depending on no other
23-
packages. Supported transports include inproc (intra-process), IPC
24-
(inter-process), TCP/IP (IPv4 or IPv6), and WebSocket. The inproc
25-
transport uses zero-copy where possible for a much faster solution than
26-
alternatives.
23+
packages. Provides the interface for code and processes to communicate
24+
with each other - receive data generated in Python, perform analysis in
25+
R, and send results to a C++ program – all on the same computer or on
26+
networks spanning the globe.
2727

28-
Can be used for sending data across networks, but equally as an
29-
interface for code and processes to communicate with each other. Receive
30-
data generated in Python, perform analysis in R, and send results to a
31-
C++ program – all on the same computer or on networks spanning the
32-
globe.
28+
Implemented scalability protocols:
29+
30+
- Bus (routing)
31+
- Pair (two-way radio)
32+
- Pipeline (one-way pipe)
33+
- Publisher/Subscriber (topics & broadcast)
34+
- Request/Reply (I ask, you answer)
35+
- Survey (everyone votes)
36+
37+
Implemented transports:
38+
39+
- inproc (intra-process)
40+
- IPC (inter-process)
41+
- TCP/IP (IPv4 or IPv6)
42+
- WebSocket
3343

3444
### Table of Contents
3545

@@ -70,6 +80,8 @@ Dialer/Listener. Methods such as `$send()` or `$recv()` can then be
7080
accessed directly from the object.
7181

7282
*Example using Request/Reply (REQ/REP) protocol with inproc transport:*
83+
<br /> (The inproc transport uses zero-copy where possible for a much
84+
faster solution than alternatives)
7385

7486
Create nano objects:
7587

@@ -145,8 +157,8 @@ recv(socket2)
145157
### Cross-language Exchange
146158

147159
{nanonext} provides a fast and reliable data interface between different
148-
programming languages where NNG has a binding, including C, C++, Python,
149-
Go, Rust etc.
160+
programming languages where NNG has a binding, including C, C++, Java,
161+
Python, Go, Rust etc.
150162

151163
The following example demonstrates the exchange of numerical data
152164
between R and Python (NumPy), two of the most commonly-used languages
@@ -238,7 +250,7 @@ res$result
238250
```
239251

240252
For a ‘recvAio’ object, calling the message causes it to be stored in
241-
the AIO as `$raw` and/or `$data` as the case may be.
253+
the AIO as `$raw` (if kept) and `$data`.
242254

243255
``` r
244256
msg <- recv_aio(s2)
@@ -279,7 +291,7 @@ I/O-bound operations such as writing large amounts of data to disk in a
279291
separate ‘server’ process running concurrently.
280292

281293
Server process: `reply()` will wait for a message and apply a function,
282-
in this case `rnorm()`, before sending back the result.
294+
in this case `rnorm()`, before sending back the result
283295

284296
``` r
285297
library(nanonext)
@@ -318,7 +330,7 @@ aio
318330
#> < recvAio >
319331
#> - $data for message data
320332
str(aio$data)
321-
#> num [1:100000000] -1.104 1.34 0.442 -0.738 0.66 ...
333+
#> num [1:100000000] -0.69 -1.535 -0.463 0.012 0.768 ...
322334
```
323335

324336
In this example the calculation is returned, but other operations may
@@ -387,11 +399,11 @@ ncurl("http://httpbin.org/headers")
387399
#> [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
388400
#> [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
389401
#> [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
390-
#> [76] 2d 36 32 30 34 30 34 66 65 2d 30 62 39 31 61 34 61 63 32 61 36 62 31 36 34
391-
#> [101] 31 36 61 30 32 38 30 30 63 22 0a 20 20 7d 0a 7d 0a
402+
#> [76] 2d 36 32 30 34 63 34 63 34 2d 32 30 34 38 64 39 38 64 34 36 36 32 34 61 39
403+
#> [101] 64 33 63 32 37 33 33 36 34 22 0a 20 20 7d 0a 7d 0a
392404
#>
393405
#> $data
394-
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-620404fe-0b91a4ac2a6b16416a02800c\"\n }\n}\n"
406+
#> [1] "{\n \"headers\": {\n \"Host\": \"httpbin.org\", \n \"X-Amzn-Trace-Id\": \"Root=1-6204c4c4-2048d98d46624a9d3c273364\"\n }\n}\n"
395407
```
396408

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

man/nanonext-package.Rd

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

tools/winlibs.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
if (!file.exists("../windows/rwinlib-1.5.2/include/nng.h")) {
44

55
if (getRversion() < "3.3.0") setInternet2()
6-
download.file("https://github.com/shikokuchuo/rwinlib/archive/refs/tags/v1.5.2.zip", destfile = "nng-latest.zip", quiet = TRUE)
6+
download.file("https://github.com/shikokuchuo/rwinlib/archive/refs/tags/v1.5.2.zip", destfile = "nng-release.zip", quiet = TRUE)
77
dir.create("../windows", showWarnings = FALSE)
8-
unzip("nng-latest.zip", exdir = "../windows")
9-
unlink("nng-latest.zip")
8+
unzip("nng-release.zip", exdir = "../windows")
9+
unlink("nng-release.zip")
1010

1111
}
1212

0 commit comments

Comments
 (0)