Skip to content

Commit 6d8b2af

Browse files
evalFuture(): Add argument 'context'; dropped 'strategiesR' and 'threads'
1 parent e5679f0 commit 6d8b2af

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

R/Future-class.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ getExpression <- function(future, ...) UseMethod("getExpression")
659659
getExpression.Future <- local({
660660
tmpl_expr_evaluate2 <- bquote_compile({
661661
## Evaluate future
662-
future:::evalFuture(core = .(core), capture = .(capture), local = .(local), split = .(split), immediateConditionClasses = .(immediateConditionClasses), strategiesR = .(strategiesR), forwardOptions = .(forwardOptions), threads = .(threads), cleanup = .(cleanup))
662+
future:::evalFuture(core = .(core), capture = .(capture), context = .(context), split = .(split), immediateConditionClasses = .(immediateConditionClasses), forwardOptions = .(forwardOptions), local = .(local), cleanup = .(cleanup))
663663
})
664664

665665
function(future, expr = future$expr, immediateConditions = FALSE, mc.cores = NULL, threads = NA_integer_, cleanup = TRUE, ...) {
@@ -739,6 +739,11 @@ getExpression.Future <- local({
739739
conditionClasses = conditionClasses
740740
)
741741

742+
context <- list(
743+
threads = threads,
744+
strategiesR = strategiesR
745+
)
746+
742747
forwardOptions <- list(
743748
## Assert globals when future is created (or at run time)?
744749
future.globals.onMissing = getOption("future.globals.onMissing"),

R/expressions.R

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ evalFuture <- function(
1515
stdout = TRUE,
1616
conditionClasses = character(0L)
1717
),
18-
local = FALSE,
18+
context = list(
19+
strategiesR = NULL,
20+
threads = NA_integer_
21+
),
1922
split = FALSE,
2023
immediateConditionClasses = character(0L),
2124
forwardOptions = NULL,
22-
strategiesR = NULL,
23-
threads = NA_integer_,
25+
local = FALSE,
2426
envir = parent.frame(),
2527
cleanup = TRUE) {
2628
expr <- core$expr
@@ -32,6 +34,10 @@ evalFuture <- function(
3234
if (is.null(stdout)) stdout <- TRUE
3335
conditionClasses <- capture$conditionClasses
3436

37+
strategiesR <- context$strategiesR
38+
threads <- context$threads
39+
if (is.null(threads)) threads <- NA_integer_
40+
3541
stop_if_not(
3642
length(local) == 1L && is.logical(local) && !is.na(local),
3743
length(stdout) == 1L && is.logical(stdout),

0 commit comments

Comments
 (0)