Skip to content

Commit 485fb97

Browse files
Add support for logical attribute 'dispose' of hidden, internal R option 'future.disposable'
1 parent c1dcf97 commit 485fb97

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.apply
2-
Version: 1.20.1-9004
2+
Version: 1.20.1-9005
33
Title: Apply Function to Elements in Parallel using Futures
44
Depends:
55
R (>= 3.2.0),

R/future_apply.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ future_apply <- function(X, MARGIN, FUN, ..., simplify = TRUE, future.envir = pa
9595
var <- sprintf("future.%s", name)
9696
assign(var, opts[[name]], envir = environment(), inherits = FALSE)
9797
}
98-
options(future.disposable = NULL)
98+
if (!identical(attr(opts, "dispose"), FALSE)) {
99+
options(future.disposable = NULL)
100+
}
99101

100102

101103
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

R/future_mapply.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ future_mapply <- function(FUN, ..., MoreArgs = NULL, SIMPLIFY = TRUE, USE.NAMES
108108
var <- sprintf("future.%s", name)
109109
assign(var, opts[[name]], envir = environment(), inherits = FALSE)
110110
}
111-
options(future.disposable = NULL)
111+
if (!identical(attr(opts, "dispose"), FALSE)) {
112+
options(future.disposable = NULL)
113+
}
112114

113115

114116
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

R/future_xapply.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ future_xapply <- local({
3434
var <- sprintf("future.%s", name)
3535
assign(var, opts[[name]], envir = environment(), inherits = FALSE)
3636
}
37-
options(future.disposable = NULL)
37+
if (!identical(attr(opts, "dispose"), FALSE)) {
38+
options(future.disposable = NULL)
39+
}
3840

3941

4042
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

0 commit comments

Comments
 (0)