Skip to content

Commit f5d0fae

Browse files
CLEANUP: Remove argument gc from future(), futureAssign(), and futureCall()
1 parent 0fe6005 commit f5d0fae

File tree

11 files changed

+13
-63
lines changed

11 files changed

+13
-63
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-9017
2+
Version: 1.68.0-9018
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

NEWS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
## Deprecated and Defunct
2424

25-
* Remove argument `earlySignal` from `future()`, `futureAssign()`,
26-
and `futureCall()`. Attempts to set it is now ignored and will
27-
produce a deprecation warning.
25+
* Remove arguments `earlySignal` and `gc` from `future()`,
26+
`futureAssign()`, and `futureCall()`. Attempts to set them are now
27+
ignored and will produce deprecation warnings.
2828

2929
* The `cluster` backend now defaults to `earlySignal = FALSE`. This
3030
was effectively already the case, because of an internal thinko

R/backend_api-Future-class.R

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@
7070
#' @param lazy If FALSE (default), the future is resolved
7171
#' eagerly (starting immediately), otherwise not.
7272
#'
73-
#' @param gc If TRUE, the garbage collector run (in the process that
74-
#' evaluated the future) only after the value of the future is collected.
75-
#' Exactly when the values are collected may depend on various factors,
76-
#' including the number of free workers.
77-
#' _Some future backends may ignore this argument._
78-
#'
7973
#' @param label A character string label attached to the future.
8074
#'
8175
#' @param \ldots Additional named elements of the future.
@@ -97,7 +91,7 @@
9791
#' @export
9892
#' @keywords internal
9993
#' @name Future-class
100-
Future <- function(expr = NULL, envir = parent.frame(), substitute = TRUE, stdout = TRUE, conditions = "condition", globals = list(), packages = NULL, seed = FALSE, lazy = FALSE, gc = FALSE, label = NULL, ...) {
94+
Future <- function(expr = NULL, envir = parent.frame(), substitute = TRUE, stdout = TRUE, conditions = "condition", globals = list(), packages = NULL, seed = FALSE, lazy = FALSE, label = NULL, ...) {
10195
if (substitute) expr <- substitute(expr)
10296
t_start <- Sys.time()
10397

@@ -220,7 +214,6 @@ Future <- function(expr = NULL, envir = parent.frame(), substitute = TRUE, stdou
220214

221215
## Future miscellaneous
222216
core[["label"]] <- label
223-
core[["gc"]] <- gc
224217

225218
core[["onReference"]] <- onReference
226219
core[["owner"]] <- session_uuid()

R/core_api-future.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,13 @@
160160
#' @aliases futureCall
161161
#' @rdname future
162162
#' @export
163-
future <- function(expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = FALSE, globals = TRUE, packages = NULL, stdout = TRUE, conditions = "condition", label = NULL, gc = FALSE, ...) {
163+
future <- function(expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = FALSE, globals = TRUE, packages = NULL, stdout = TRUE, conditions = "condition", label = NULL, ...) {
164164
debug <- isTRUE(getOption("future.debug"))
165165
if (debug) {
166166
mdebugf_push("future(..., label = %s) ...", sQuoteLabel(label))
167167
mdebugf("lazy: %s", lazy)
168168
mdebugf("stdout: %s", stdout)
169169
mdebugf("conditions: [n=%d] %s", length(conditions), commaq(conditions))
170-
mdebugf("gc: %s", gc)
171170
on.exit(mdebugf_pop())
172171
}
173172

@@ -198,14 +197,13 @@ future <- function(expr, envir = parent.frame(), substitute = TRUE, lazy = FALSE
198197
stdout = stdout,
199198
conditions = conditions,
200199
label = label,
201-
gc = gc,
202200
onReference = onReference,
203201
...)
204202

205203
args_names <- names(list(...))
206204

207-
## Deprecation of arguments 'earlySignal'
208-
for (name in c("earlySignal")) {
205+
## Deprecation of arguments 'earlySignal' and 'gc'
206+
for (name in c("earlySignal", "gc")) {
209207
if (!is.null(future[[name]])) {
210208
if (is.element(name, args_names)) {
211209
deprecateFutureArgument(name, future[[name]])

R/delayed_api-futureAssign.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@
185185
#'
186186
#' @rdname futureAssign
187187
#' @export
188-
futureAssign <- function(x, value, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = FALSE, globals = TRUE, packages = NULL, stdout = TRUE, conditions = "condition", label = NULL, gc = FALSE, ..., assign.env = envir) {
188+
futureAssign <- function(x, value, envir = parent.frame(), substitute = TRUE, lazy = FALSE, seed = FALSE, globals = TRUE, packages = NULL, stdout = TRUE, conditions = "condition", label = NULL, ..., assign.env = envir) {
189189
stop_if_not(is.character(x), !is.na(x), nzchar(x))
190190
if (substitute) value <- substitute(value)
191191

192192
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
193193
## (1) Arguments passed to future()
194194
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
195-
future.args <- list(value, envir = envir, lazy = lazy, seed = seed, globals = globals, packages = packages, stdout = stdout, conditions = conditions, label = label, gc = gc, ...)
195+
future.args <- list(value, envir = envir, lazy = lazy, seed = seed, globals = globals, packages = packages, stdout = stdout, conditions = conditions, label = label, ...)
196196
## Any arguments set via disposible option?
197197
args <- getOption("future.disposable")
198198
if (!is.null(args)) {

R/utils-options.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,4 +468,5 @@ update_package_options <- function(debug = FALSE) {
468468

469469
## future (> 1.68.0)
470470
update_package_option("future.future.earlySignal", mode = "character", debug = debug)
471+
update_package_option("future.future.gc", mode = "character", debug = debug)
471472
}

R/utils_api-futureCall.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#'
1717
#' @rdname future
1818
#' @export
19-
futureCall <- function(FUN, args = list(), envir = parent.frame(), lazy = FALSE, seed = FALSE, globals = TRUE, packages = NULL, stdout = TRUE, conditions = "condition", label = NULL, gc = FALSE, ...) {
19+
futureCall <- function(FUN, args = list(), envir = parent.frame(), lazy = FALSE, seed = FALSE, globals = TRUE, packages = NULL, stdout = TRUE, conditions = "condition", label = NULL, ...) {
2020
stop_if_not(is.function(FUN))
2121
stop_if_not(is.list(args))
2222

@@ -96,7 +96,7 @@ futureCall <- function(FUN, args = list(), envir = parent.frame(), lazy = FALSE,
9696
mstr(globals)
9797
}
9898

99-
f <- future(expr, substitute = FALSE, envir = envir, lazy = lazy, seed = seed, globals = globals, packages = packages, stdout = stdout, conditions = conditions, label = label, gc = gc, ...)
99+
f <- future(expr, substitute = FALSE, envir = envir, lazy = lazy, seed = seed, globals = globals, packages = packages, stdout = stdout, conditions = conditions, label = label, ...)
100100

101101
if (debug) mdebug_pop()
102102

inst/testme/test-future.R

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ local({
3131

3232
message("*** future() w/ lazy = TRUE in local() ... DONE")
3333

34-
message("*** future() w/ gc = TRUE ...")
35-
36-
f <- future(42L, gc = TRUE, lazy = TRUE)
37-
print(f)
38-
y <- value(f)
39-
print(y)
40-
stopifnot(y == 42L)
41-
42-
message("*** future() w/ gc = TRUE ... DONE")
4334
message("*** future() ... DONE")
4435

4536
message("*** future() ...")
@@ -54,17 +45,6 @@ print(y)
5445
stopifnot(y == 42L)
5546

5647

57-
message("*** future() w/ gc = TRUE ...")
58-
59-
f <- future(42L, gc = TRUE, lazy = TRUE)
60-
print(f)
61-
y <- value(f)
62-
print(y)
63-
stopifnot(y == 42L)
64-
65-
message("*** future() w/ gc = TRUE ... DONE")
66-
67-
6848
message("*** future() - exceptions ...")
6949

7050
target <- list(name = "<unknown>", envir = new.env(), code = "Yo!", exists = TRUE)

man/Future-class.Rd

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/future.Rd

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)