Skip to content

Commit

Permalink
more code style
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Dec 5, 2023
1 parent ee06c6c commit b490867
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mirai
Type: Package
Title: Minimalist Async Evaluation Framework for R
Version: 0.11.2.9023
Version: 0.11.2.9024
Description: Lightweight parallel code execution and distributed computing.
Designed for simplicity, a 'mirai' evaluates an R expression asynchronously,
on local or network resources, resolving automatically upon completion.
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mirai 0.11.2.9023 (development)
# mirai 0.11.2.9024 (development)

* Implements `register()` for registering custom serialization and unserialization functions when using daemons.
* Introduces `call_mirai_()`, a user-interruptible version of `call_mirai()` suitable for interactive use.
Expand Down
6 changes: 3 additions & 3 deletions R/daemons.R
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,9 @@ launch_and_sync_daemon <- function(sock, ..., rs = NULL, tls = NULL, pass = NULL

init_monitor <- function(sockc, envir) {
res <- query_dispatcher(sockc, command = FALSE, mode = 2L)
is.object(res) && return(FALSE)
`[[<-`(`[[<-`(`[[<-`(envir, "sockc", sockc), "urls", res[-1L]), "pid", as.integer(res[1L]))
TRUE
valid <- !is.object(res)
if (valid) `[[<-`(`[[<-`(`[[<-`(envir, "sockc", sockc), "urls", res[-1L]), "pid", as.integer(res[1L]))
valid
}

store_urls <- function(sock, envir) {
Expand Down
3 changes: 1 addition & 2 deletions R/dispatcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ get_tls <- function(baseurl, tls, pass) {
sub_real_port <- function(port, url) sub("(?<=:)0(?![^/])", port, url, perl = TRUE)

query_dispatcher <- function(sock, command, mode) {
res <- send(sock, data = command, mode = 2L, block = .timelimit)
res && return(res)
send(sock, data = command, mode = 2L, block = .timelimit)
recv(sock, mode = mode, block = .timelimit + .timelimit)
}

Expand Down

0 comments on commit b490867

Please sign in to comment.