RushWorker inherits all methods from Rush. Upon initialization, the worker registers itself in the Redis database.
Value
Object of class R6::R6Class and RushWorker with worker methods.
Super class
rush::Rush -> RushWorker
Public fields
worker_id(
character(1))
Identifier of the worker.heartbeat(
callr::r_bg)
Background process for the heartbeat.
Active bindings
terminated(
logical(1))
Whether to shutdown the worker. Used in the worker loop to determine whether to continue.
Methods
Inherited methods
rush::Rush$detect_lost_workers()rush::Rush$empty_queue()rush::Rush$fail_tasks()rush::Rush$fetch_failed_tasks()rush::Rush$fetch_finished_tasks()rush::Rush$fetch_new_tasks()rush::Rush$fetch_queued_tasks()rush::Rush$fetch_running_tasks()rush::Rush$fetch_tasks()rush::Rush$fetch_tasks_with_state()rush::Rush$finish_tasks()rush::Rush$format()rush::Rush$is_failed_task()rush::Rush$is_running_task()rush::Rush$pop_task()rush::Rush$print()rush::Rush$print_log()rush::Rush$push_failed()rush::Rush$push_failed_tasks()rush::Rush$push_finished_tasks()rush::Rush$push_results()rush::Rush$push_running_tasks()rush::Rush$push_tasks()rush::Rush$read_hash()rush::Rush$read_hashes()rush::Rush$read_log()rush::Rush$reconnect()rush::Rush$reset()rush::Rush$reset_cache()rush::Rush$start_local_workers()rush::Rush$start_remote_workers()rush::Rush$start_workers()rush::Rush$stop_workers()rush::Rush$tasks_with_state()rush::Rush$wait_for_tasks()rush::Rush$wait_for_workers()rush::Rush$worker_script()rush::Rush$write_hashes()
Method new()
Creates a new instance of this R6 class.
Usage
RushWorker$new(
network_id,
config = NULL,
worker_id = NULL,
heartbeat_period = NULL,
heartbeat_expire = NULL
)Arguments
network_id(
character(1))
Identifier of the rush network. Manager and workers must have the same id. Keys in Redis are prefixed with the instance id.config(redux::redis_config)
Redis configuration options. IfNULL, configuration set byrush_plan()is used. Ifrush_plan()has not been called, theREDIS_URLenvironment variable is parsed. IfREDIS_URLis not set, a default configuration is used. See redux::redis_config for details.worker_id(
character(1))
Identifier of the worker. Keys in redis specific to the worker are prefixed with the worker id.heartbeat_period(
integer(1))
Period of the heartbeat in seconds. The heartbeat is updated everyheartbeat_periodseconds.heartbeat_expire(
integer(1))
Time to live of the heartbeat in seconds. The heartbeat key is set to expire afterheartbeat_expireseconds.
Method set_terminated()
Mark the worker as terminated. Last step in the worker loop before the worker terminates.