Skip to content

Commit

Permalink
avoid .unresolved() in recvAio promises
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Dec 2, 2024
1 parent 2d05ebb commit cf9ea4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/aio.R
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ as.promise.recvAio <- function(x) {

if (is.null(promise)) {

promise <- if (.unresolved(x)) {
promise <- if (unresolved(x)) {

promises::promise(
function(resolve, reject) .keep(x, environment())
Expand All @@ -370,7 +370,7 @@ as.promise.recvAio <- function(x) {
if (is_error_value(value)) stop(nng_error(value)) else value
)
} else {
value <- collect_aio(x)
value <- .subset2(x, "value")
promises::promise(
function(resolve, reject)
if (is_error_value(value)) reject(nng_error(value)) else resolve(value)
Expand Down

0 comments on commit cf9ea4f

Please sign in to comment.