Skip to content

Commit 45b8f83

Browse files
committed
re-factor aio c code
1 parent a2bc091 commit 45b8f83

File tree

10 files changed

+503
-425
lines changed

10 files changed

+503
-425
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* New `stream()` interface exposes low-level byte stream functionality in the NNG library, intended for communicating with non-NNG endpoints, including but not limited to websocket servers.
66
* `ncurl()` adds an 'async' option to perform HTTP requests asynchronously, returning immediately with a 'recvAio'. Also adds explicit arguments for HTTP method, headers (which takes a named list or character vector) and request data.
7-
* New `messenger()` function implements a console-based 2-way messaging system using NNG's scalability protocols [currently experimental and undergoing early-stage testing].
7+
* New `messenger()` function implements a console-based 2-way messaging system using NNG's scalability protocols [currently experimental and undergoing testing].
88

99
#### Updates
1010

R/aio.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,14 @@ send_aio.nanoStream <- function(con, data, mode = "raw", timeout) {
122122
}
123123
env <- `class<-`(new.env(), "sendAio")
124124
result <- NULL
125+
unresolv <- TRUE
125126
makeActiveBinding(sym = "result", fun = function(x) {
126-
if (is.null(result)) {
127+
if (unresolv) {
127128
res <- .Call(rnng_aio_result, aio)
128129
missing(res) && return(.Call(rnng_aio_unresolv))
129130
if (res) logerror(res)
130131
result <<- res
132+
unresolv <<- FALSE
131133
}
132134
result
133135
}, env = env)
@@ -373,7 +375,7 @@ recv_aio.nanoStream <- function(con,
373375
if (keep.raw) {
374376
makeActiveBinding(sym = "raw", fun = function(x) {
375377
if (unresolv) {
376-
res <- .Call(rnng_aio_stream_recv, aio)
378+
res <- .Call(rnng_aio_stream_in, aio)
377379
missing(res) && return(.Call(rnng_aio_unresolv))
378380
is.integer(res) && {
379381
data <<- raw <<- `class<-`(res, "errorValue")
@@ -397,7 +399,7 @@ recv_aio.nanoStream <- function(con,
397399
}
398400
makeActiveBinding(sym = "data", fun = function(x) {
399401
if (unresolv) {
400-
res <- .Call(rnng_aio_stream_recv, aio)
402+
res <- .Call(rnng_aio_stream_in, aio)
401403
missing(res) && return(.Call(rnng_aio_unresolv))
402404
is.integer(res) && {
403405
data <<- raw <<- `class<-`(res, "errorValue")

R/messenger.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#' \code{:q} is the command to quit.
2020
#'
2121
#' NOTE: This is an experimental feature that is currently undergoing
22-
#' early-stage testing.
22+
#' testing.
2323
#'
2424
#' @export
2525
#'

man/messenger.Rd

Lines changed: 1 addition & 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)