Skip to content

Commit

Permalink
code styling tidy ups
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Dec 30, 2024
1 parent 824f738 commit 1be68d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions R/daemon.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/daemons.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions R/dispatcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -275,14 +275,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)
Expand Down

0 comments on commit 1be68d5

Please sign in to comment.