Skip to content

Commit

Permalink
syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 1, 2023
1 parent 7332de9 commit b11e6f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion R/daemon.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ daemon <- function(url, autoexit = TRUE, cleanup = TRUE, output = FALSE,
data <- tryCatch(eval(expr = ._mirai_.[[".expr"]], envir = ._mirai_., enclos = NULL),
error = mk_mirai_error, interrupt = mk_interrupt_error)
send(sock, data = data, mode = 1L, block = TRUE)
msleep(.exitlinger)
msleep(2000L)

}

Expand Down
6 changes: 3 additions & 3 deletions R/dispatcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ dispatcher <- function(host, url = NULL, n = NULL, ..., asyncdial = FALSE,
if (is.object(req)) req <- serialize(req, NULL)
send_aio(queue[[i]][["ctx"]], data = req, mode = 2L)
q <- queue[[i]][["daemon"]]
if (req[1L] == .nextformat) {
if (req[1L] == .nextmode) {
ctx <- .context(servers[[q]])
send_aio(ctx, data = .nextformat, mode = 2L)
send_aio(ctx, data = .nextmode, mode = 2L)
reap(ctx)
} else {
serverfree[q] <- TRUE
Expand Down Expand Up @@ -331,4 +331,4 @@ get_and_reset_env <- function(x) {
}
}

.nextformat <- as.raw(7L)
.nextmode <- as.raw(7L)
1 change: 0 additions & 1 deletion R/mirai-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ registerPromisesMethods <- function() {
),
hash = TRUE
)
.exitlinger <- 2000L
.timelimit <- 5000L

as.promise <- NULL
Expand Down
11 changes: 5 additions & 6 deletions R/parallel.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ make_cluster <- function(n, url = NULL, remote = NULL, ...) {
n <- if (is.list(args)) length(args) else 1L
} else {
missing(n) && stop(.messages[["requires_n"]])
if (interactive()) {
message("Shell commands for deployment on nodes:")
printLaunchCmd <- TRUE
}
if (interactive()) printLaunchCmd <- TRUE
}

daemons(url = url, remote = remote, dispatcher = FALSE, resilience = FALSE, cleanup = FALSE, ..., .compute = id)
Expand All @@ -126,8 +123,10 @@ make_cluster <- function(n, url = NULL, remote = NULL, ...) {
for (i in seq_along(cl))
cl[[i]] <- `attributes<-`(new.env(), list(class = "miraiNode", node = i, id = id))

if (printLaunchCmd)
if (printLaunchCmd) {
message("Shell commands for deployment on nodes:")
print(launch_remote(rep(..[[id]][["urls"]], n), .compute = id))
}

`attributes<-`(cl, list(class = c("miraiCluster", "cluster"), id = id))

Expand Down Expand Up @@ -168,7 +167,7 @@ sendData.miraiNode <- function(node, data) {
.signal = has_tag, .compute = attr(node, "id"))

if (has_tag)
assign("tag", value[["tag"]], node[["mirai"]])
assign("tag", value[["tag"]], .subset2(node, "mirai"))

}

Expand Down

0 comments on commit b11e6f0

Please sign in to comment.