Skip to content

Commit 9c4c7c6

Browse files
CLEANUP: Remove need for calling resolved(future, run = FALSE)
1 parent cc5be31 commit 9c4c7c6

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.68.0-9028
2+
Version: 1.68.0-9029
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

R/backend_api-03.MultiprocessFutureBackend-class.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ listFutures.MultiprocessFutureBackend <- function(backend, ..., debug = FALSE) {
6060
counter <- as.integer(future[["uuid"]][2])
6161
start <- future[["start"]]
6262
if (is.null(start)) start <- NA_real_ ## happens if future is reset
63-
resolved <- resolved(future, run = FALSE)
63+
64+
## Avoid triggering resolved() launching a lazy future
65+
if (future[["state"]] == "created") {
66+
resolved <- FALSE
67+
} else {
68+
resolved <- resolved(future)
69+
}
70+
6471
data.frame(
6572
counter = counter,
6673
start = start,

R/backend_api-FutureRegistry.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ FutureRegistry <- local({
8787
## NOTE: It is when calling resolved() on a future with
8888
## early signaling is enabled that conditioned
8989
## may be signaled.
90-
if (resolved(future, run = FALSE, .signalEarly = FALSE)) {
90+
if ((!future[["state"]] %in% "created") &&
91+
resolved(future, .signalEarly = FALSE)) {
9192
if (debug) mdebugf_push("Future at position #%d is resolved ...", ii)
9293
## (a) Let future cleanup after itself, iff needed.
9394
## This, this may result in a call to

0 commit comments

Comments
 (0)