From c7e3be84c08b9e64e40202902dd7cc2f3dc2b4b2 Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Mon, 30 Dec 2024 17:34:04 +0000 Subject: [PATCH] code style tidy ups --- R/daemon.R | 6 +++--- R/daemons.R | 2 +- R/dispatcher.R | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/daemon.R b/R/daemon.R index ad17b3b5..50040d1e 100644 --- a/R/daemon.R +++ b/R/daemon.R @@ -97,7 +97,7 @@ daemon <- function(url, dispatcher = FALSE, ..., asyncdial = FALSE, autoexit = T ) ) cv <- cv() - sock <- socket(protocol = if (dispatcher) "poly" else "rep") + sock <- socket(if (dispatcher) "poly" else "rep") on.exit(reap(sock)) `[[<-`(., "sock", sock) autoexit && pipe_notify(sock, cv = cv, remove = TRUE, flag = as.integer(autoexit)) @@ -239,7 +239,7 @@ v1_daemon <- function(url, asyncdial = FALSE, autoexit = TRUE, cleanup = TRUE, timerstart = 0L, ..., tls = NULL, rs = NULL) { cv <- cv() - sock <- socket(protocol = "rep") + sock <- socket("rep") on.exit(reap(sock)) `[[<-`(., "sock", sock) autoexit && pipe_notify(sock, cv = cv, remove = TRUE, flag = as.integer(autoexit)) @@ -309,7 +309,7 @@ v1_daemon <- function(url, asyncdial = FALSE, autoexit = TRUE, cleanup = TRUE, .daemon <- function(url) { cv <- cv() - sock <- socket(protocol = "rep") + sock <- socket("rep") on.exit(reap(sock)) pipe_notify(sock, cv = cv, remove = TRUE) dial(sock, url = url, autostart = NA, error = TRUE) diff --git a/R/daemons.R b/R/daemons.R index 72a12516..98341dad 100644 --- a/R/daemons.R +++ b/R/daemons.R @@ -515,7 +515,7 @@ init_envir_stream <- function(seed) { tokenized_url <- function(url) sprintf("%s/%s", url, random(12L)) req_socket <- function(url, tls = NULL, resend = 0L) - `opt<-`(socket(protocol = "req", listen = url, tls = tls), "req:resend-time", resend) + `opt<-`(socket("req", listen = url, tls = tls), "req:resend-time", resend) parse_dispatcher <- function(x) { x <- x[1L] diff --git a/R/dispatcher.R b/R/dispatcher.R index ab097b71..5bb64266 100644 --- a/R/dispatcher.R +++ b/R/dispatcher.R @@ -70,7 +70,7 @@ dispatcher <- function(host, url = NULL, n = NULL, ..., tls = NULL, pass = NULL, n > 0L || stop(._[["missing_url"]]) cv <- cv() - sock <- socket(protocol = "rep") + sock <- socket("rep") on.exit(reap(sock)) pipe_notify(sock, cv = cv, remove = TRUE, flag = TRUE) dial_and_sync_socket(sock, host) @@ -95,7 +95,7 @@ dispatcher <- function(host, url = NULL, n = NULL, ..., tls = NULL, pass = NULL, } pass <- NULL - psock <- socket(protocol = "poly") + psock <- socket("poly") on.exit(reap(psock), add = TRUE, after = TRUE) `opt<-`(psock, "send-buffer", 1L) m <- monitor(psock, cv) @@ -281,14 +281,14 @@ v1_dispatcher <- function(host, url = NULL, n = NULL, ..., retry = FALSE, n > 0L || stop(._[["missing_url"]]) cv <- cv() - sock <- socket(protocol = "rep") + sock <- socket("rep") on.exit(reap(sock)) pipe_notify(sock, cv = cv, remove = TRUE, flag = TRUE) dial_and_sync_socket(sock, host) ctrchannel <- is.character(monitor) if (ctrchannel) { - sockc <- socket(protocol = "rep") + sockc <- socket("rep") on.exit(reap(sockc), add = TRUE, after = FALSE) pipe_notify(sockc, cv = cv, remove = TRUE, flag = TRUE) dial_and_sync_socket(sockc, monitor)