Skip to contents

Stores the number of workers and Redis configuration options (redux::redis_config) for Rush. The function tests the connection to Redis and throws an error if the connection fails.

Usage

rush_plan(
  n_workers = NULL,
  config = NULL,
  lgr_thresholds = NULL,
  large_objects_path = NULL,
  start_worker_timeout = Inf
)

Arguments

n_workers

(integer(1))
Number of workers to be started.

config

(redux::redis_config)
Configuration options used to connect to Redis. If NULL, the REDIS_URL environment variable is parsed. If REDIS_URL is not set, a default configuration is used. See redux::redis_config for details.

lgr_thresholds

(named character() | named numeric())
Logger threshold on the workers e.g. c(rush = "debug").

large_objects_path

(character(1))
The path to the directory where large objects are stored.

start_worker_timeout

(numeric(1))
The time in seconds to wait for a worker to start.

Value

list() with the stored configuration.

Examples

# This example is not executed since Redis must be installed
# \donttest{
   config_local = redux::redis_config()
   rush_plan(config = config_local, n_workers = 2)
#> Error in rush_plan(config = config_local, n_workers = 2): Can't connect to Redis. Check the configuration.

   rush = rsh(network_id = "test_network")
#> Error in initialize(...): Can't connect to Redis. Check the configuration.
   rush
#> Error: object 'rush' not found
# }