From 64f1eddc3c812cd8f80edfce566864bd9068765b Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:29:27 +0000 Subject: [PATCH] cleaner dispatcher logic --- R/dispatcher.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/dispatcher.R b/R/dispatcher.R index dd2e1673..0e4c3977 100644 --- a/R/dispatcher.R +++ b/R/dispatcher.R @@ -205,17 +205,17 @@ dispatcher <- function(host, url = NULL, n = NULL, ..., tls = NULL, pass = NULL, next } if (value[4L]) { - if (value[4L] > 1L) { + if (value[4L] == 1L) { + send(outq[[id]][["ctx"]], value, mode = 2L, block = TRUE) + send(psock, 0L, mode = 2L, pipe = outq[[id]][["pipe"]], block = TRUE) + if (length(outq[[id]][["dmnid"]])) + events <- c(events, outq[[id]][["dmnid"]]) + outq[[id]] <- NULL + } else { dmnid <- readBin(value, "integer", n = 2L)[2L] events <- c(events, dmnid) outq[[id]][["dmnid"]] <- -dmnid - next } - send(outq[[id]][["ctx"]], value, mode = 2L, block = TRUE) - send(psock, 0L, mode = 2L, pipe = outq[[id]][["pipe"]], block = TRUE) - if (length(outq[[id]][["dmnid"]])) - events <- c(events, outq[[id]][["dmnid"]]) - outq[[id]] <- NULL next } else { send(outq[[id]][["ctx"]], value, mode = 2L, block = TRUE)