Skip to content

Commit

Permalink
wait_mirai() -> call_safe()
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Nov 21, 2023
1 parent 304dcb9 commit 739c0cf
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions 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.9004
Version: 0.11.2.9005
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 All @@ -23,7 +23,7 @@ Encoding: UTF-8
Depends:
R (>= 3.5)
Imports:
nanonext (>= 0.10.4.9004)
nanonext (>= 0.10.4.9007)
Enhances:
parallel,
promises
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ S3method(sendData,miraiNode)
S3method(stopCluster,miraiCluster)
export(.daemon)
export(call_mirai)
export(call_safe)
export(daemon)
export(daemons)
export(dispatcher)
Expand All @@ -36,11 +37,11 @@ export(status)
export(stop_cluster)
export(stop_mirai)
export(unresolved)
export(wait_mirai)
importFrom(nanonext,"opt<-")
importFrom(nanonext,.context)
importFrom(nanonext,base64dec)
importFrom(nanonext,call_aio)
importFrom(nanonext,call_safe)
importFrom(nanonext,cv)
importFrom(nanonext,cv_value)
importFrom(nanonext,dial)
Expand Down Expand Up @@ -69,7 +70,6 @@ importFrom(nanonext,tls_config)
importFrom(nanonext,unresolved)
importFrom(nanonext,until)
importFrom(nanonext,wait)
importFrom(nanonext,wait_aio)
importFrom(nanonext,write_cert)
importFrom(parallel,nextRNGStream)
importFrom(parallel,stopCluster)
Expand Down
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# mirai 0.11.2.9003 (development)
# mirai 0.11.2.9005 (development)

* Implements `register()` for registering custom serialization and unserialization functions when using daemons.
* Implements `wait_mirai()` for a user-interruptible version of `call_mirai()`.
* Introduces `call_safe()`, a user-interruptible version of `call_mirai()` suitable for interactive use.
* Simplification of `mirai()` interface:
+ '.args' will now coerece to a list if an object other than a list is supplied, rather than error.
+ '.signal' argument removed - now all 'mirai' signal if daemons are set up.
* `everywhere()` now returns invisible NULL in the case the specified compute profile is not set up, rather than error.
* Improved error messages and handling for daemon/dispatcher connection errors.
* Requires nanonext >= [0.10.4.9003].
* Requires nanonext >= [0.10.4.9007].

# mirai 0.11.2

Expand Down
4 changes: 2 additions & 2 deletions R/mirai-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
#' @author Charlie Gao \email{charlie.gao@@shikokuchuo.net}
#' (\href{https://orcid.org/0000-0002-0750-061X}{ORCID})
#'
#' @importFrom nanonext base64dec call_aio .context cv cv_value dial
#' @importFrom nanonext base64dec call_aio call_safe .context cv cv_value dial
#' is_error_value listen lock mclock msleep nextmode opt opt<- parse_url
#' pipe_notify random reap recv recv_aio_signal request request_signal send
#' send_aio socket stat stop_aio strcat tls_config unresolved until wait
#' wait_aio write_cert
#' write_cert
#' @importFrom parallel nextRNGStream stopCluster
#' @importFrom stats rexp
#'
Expand Down
8 changes: 4 additions & 4 deletions R/mirai.R
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,15 @@ everywhere <- function(.expr, ..., .args = list(), .compute = "default") {
#'
call_mirai <- call_aio

#' mirai (Wait Value)
#' mirai (Call Value)
#'
#' \code{wait_mirai} is identical to \code{call_mirai} but allows user
#' interrupts.
#' \code{call_safe} is identical to \code{call_mirai} but allows user
#' interrupts, thus being safe for interactive use.
#'
#' @rdname call_mirai
#' @export
#'
wait_mirai <- wait_aio
call_safe <- call_safe

#' mirai (Stop Evaluation)
#'
Expand Down
8 changes: 4 additions & 4 deletions man/call_mirai.Rd

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

2 changes: 1 addition & 1 deletion tests/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (connection) {
`lang obj` <- quote(m + n + 2L)
args <- c(m = 2L, n = 4L)
m <- mirai(.expr = `lang obj`, .args = args, .timeout = 2000L)
nanotest(is_error_value(wait_mirai(m)$data) || m$data == 8L)
nanotest(is_error_value(call_safe(m)$data) || m$data == 8L)
Sys.sleep(2.5)
}
# daemons tests
Expand Down

0 comments on commit 739c0cf

Please sign in to comment.