Skip to content

Commit

Permalink
exit wait on cv instead
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Sep 21, 2023
1 parent 5630c7e commit ca2dced
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 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.10.0.9005
Version: 0.10.0.9006
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.10.0.9005 (development)
# mirai 0.10.0.9006 (development)

* `daemon()` argument 'exitlinger' retired as daemons now synchronise with the host/dispatcher and exit as soon as possible.
* Optimises scheduling at dispatcher: tasks are no longer assigned to a daemon if it is exiting due to specified time/task-outs.
Expand Down
3 changes: 2 additions & 1 deletion R/mirai.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ daemon <- function(url, asyncdial = FALSE, maxtasks = Inf, idletime = Inf,

(count >= maxtasks || count > timerstart && mclock() - start >= walltime) && {
send(ctx, data = data, mode = 0L)
recv(sock, mode = 8L, block = .timelimit)
data <- recv_aio_signal(sock, cv = cv, mode = 8L)
wait(cv)
break
}

Expand Down

0 comments on commit ca2dced

Please sign in to comment.