Skip to content

Commit ccdf4b9

Browse files
Capture 'interrupt' conditions while evaluation the future expression
1 parent 522f670 commit ccdf4b9

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
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.34.0-9210
2+
Version: 1.34.0-9301
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Imports:
55
digest,

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
* Add new FutureBackend API for writing future backends.
1212

13+
## Bug Fixes
14+
15+
* Now 'interrupt' conditions are captured during the evaluation of
16+
the future, and results in the evaluation being terminated
17+
nicely. Previously, it would result in un-determistic behavior
18+
depending of future backend.
19+
1320
## Documentation
1421

1522
* Updated the future topology vignette with information on the

R/backend_api-evalFuture.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,13 @@ evalFuture <- function(
793793
}
794794
} ## function(cond)
795795
) ## withCallingHandlers()
796+
}, interrupt = function(ex) {
797+
FutureResult(
798+
conditions = ...future.conditions,
799+
rng = !identical(globalenv()[[".Random.seed"]], ...future.rng),
800+
globalenv = if (globalenv) list(added = setdiff(names(.GlobalEnv), ...future.globalenv.names)) else NULL,
801+
started = ...future.startTime
802+
)
796803
}, error = function(ex) {
797804
FutureResult(
798805
conditions = ...future.conditions,

0 commit comments

Comments
 (0)