Skip to content

Commit 83ba890

Browse files
Deprecate plan(..., earlySignal = ...)
1 parent 2b1e1de commit 83ba890

File tree

5 files changed

+22
-3
lines changed

5 files changed

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

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
deprecation warnings. Deprecated also hidden argument 'local',
2828
which was been there for legacy reasons.
2929

30+
* Use of `plan(..., earlySignal = ...)` is now defunct and produces a
31+
deprecation warning.
32+
3033
* The `cluster` backend now defaults to `earlySignal = FALSE`. This
3134
was effectively already the case, because of an internal thinko
3235
bug.

R/009.deprecation.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ deprecateFutureArgument <- function(name, value) {
44
action <- match.arg(action, choices = c("deprecated", "defunct", "ignore"))
55
if (action == "ignore") return()
66
dfcn <- if (action == "deprecated") .Deprecated else .Defunct
7-
dfcn(msg = sprintf("future() no longer takes argument '%s'. Attempts to use it is ignored, but will eventually become an error: %s = %s", name, name, deparse(value)[1]))
7+
dfcn(msg = sprintf("future::future() no longer takes argument '%s'. Attempts to use will eventually be ignored and then become an error: %s = %s", name, name, deparse(value)[1]))
8+
}
9+
10+
11+
deprecatePlanArgument <- function(name, value) {
12+
option <- sprintf("future.plan.%s", name)
13+
action <- getOption(option, "deprecated")
14+
action <- match.arg(action, choices = c("deprecated", "defunct", "ignore"))
15+
if (action == "ignore") return()
16+
dfcn <- if (action == "deprecated") .Deprecated else .Defunct
17+
dfcn(msg = sprintf("future::plan() no longer takes argument '%s'. Attempts to use will eventually be ignored and then become an error: %s = %s", name, name, deparse(value)[1]))
818
}
919

R/utils-options.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,4 +470,5 @@ update_package_options <- function(debug = FALSE) {
470470
update_package_option("future.future.earlySignal", mode = "character", debug = debug)
471471
update_package_option("future.future.gc", mode = "character", debug = debug)
472472
update_package_option("future.future.local", mode = "character", debug = debug)
473+
update_package_option("future.plan.earlySignal", mode = "character", debug = debug)
473474
}

R/utils_api-tweak.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ tweak.future <- function(strategy, ..., penvir = parent.frame()) {
108108
stopf("Detected arguments that must not be set via plan() or tweak(): %s",
109109
untweakable)
110110
}
111-
111+
112+
## Arguments 'earlySignal' is deprecated
113+
if ("earlySignal" %in% names) {
114+
deprecatePlanArgument("earlySignal", args[["earlySignal"]])
115+
}
116+
112117
## formals()<- drops any attributes including class
113118
attrs <- attributes(strategy)
114119
class <- class(strategy)

0 commit comments

Comments
 (0)