Skip to content

Commit

Permalink
QA fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Sep 23, 2024
1 parent fc74907 commit 616ab4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/runner-callr.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##' worker processes on the same machine. If you have used `mcstate`,
##' this is the same as "worker" processes. Unless your chains take a
##' few seconds to run, this will be slower than running with the
##' default serial runner ([mcstate_runner_serial]), however for long
##' default serial runner ([monty_runner_serial]), however for long
##' running chains, the speedup will typically scale with workers
##' added, so long as your chains divide neatly over workers.
##'
Expand Down Expand Up @@ -42,13 +42,13 @@ monty_runner_callr <- function(n_workers, progress = NULL) {
env$status[[chain_id]] <- "running"
}

## processx::poll will poll, with a timeout, all our processes.
## callr::poll will poll, with a timeout, all our processes.
## There's not much downside to a long poll because if they *are*
## ready then they will return instantly. However, the process
## will only be interruptable each time the timeout triggers, so
## use 1000 here (1s).
step <- function(timeout = 1000) {
res <- processx::poll(env$sessions, timeout)
res <- callr::poll(env$sessions, timeout)
is_done <- vcapply(res, "[[", "process") == "ready"
if (any(is_done)) {
for (session_id in which(is_done)) {
Expand Down
2 changes: 1 addition & 1 deletion man/monty_runner_callr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 616ab4b

Please sign in to comment.