Skip to content

Returns TRUE only if daemons are set, otherwise produces an informative error for the user to set daemons, with a clickable function link if the cli package is available.

Usage

require_daemons(.compute = NULL, call = environment())

Arguments

.compute

[default NULL] character value for the compute profile to use (each has its own independent set of daemons), or NULL to use the 'default' profile.

call

(only used if the cli package is installed) the execution environment of a currently running function, e.g. environment(). The function will be mentioned in error messages as the source of the error.

Value

Logical TRUE, or else errors.

Note

Previously the arguments were reversed with call coming before .compute. Specifying an environment to the first argument works for the time being, although is deprecated and will be defunct in a future version.

Examples

if (FALSE) { # interactive()
daemons(1)
require_daemons()
daemons(0)
}