diff --git a/DESCRIPTION b/DESCRIPTION index fc7ba33..d5202be 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: future.mirai -Version: 0.1.1-9014 +Version: 0.1.1-9015 Depends: future Imports: diff --git a/NAMESPACE b/NAMESPACE index a3285d0..e582c6f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -21,6 +21,7 @@ importFrom(future,resolved) importFrom(future,result) importFrom(future,run) importFrom(future,tweak) +importFrom(mirai,call_mirai_) importFrom(mirai,daemons) importFrom(mirai,is_error_value) importFrom(mirai,mirai) diff --git a/R/MiraiFuture-class.R b/R/MiraiFuture-class.R index ef7bc6d..b6dfb5a 100644 --- a/R/MiraiFuture-class.R +++ b/R/MiraiFuture-class.R @@ -152,6 +152,7 @@ mirai_version <- local({ }) #' @importFrom future result +#' @importFrom mirai call_mirai_ #' @export result.MiraiFuture <- function(future, ...) { if(isTRUE(future[["state"]] == "finished")) { @@ -165,11 +166,7 @@ result.MiraiFuture <- function(future, ...) { } mirai <- future[["mirai"]] - while (unresolved(mirai)) { - Sys.sleep(0.1) - } - - result <- mirai$data + result <- call_mirai_(mirai)$data future[["result"]] <- result future[["state"]] <- "finished"