rrq_worker_stop | R Documentation |
Stop workers, causing them to exit. Workers can be stopped in a few different ways (see Details), but after executing this function, assume that any worker targeted will no longer be available to work on tasks.
rrq_worker_stop(
worker_ids = NULL,
type = "message",
timeout = 0,
time_poll = 0.1,
progress = NULL,
controller = NULL
)
worker_ids |
Optional vector of worker ids. If |
type |
The strategy used to stop the workers. Can be |
timeout |
Optional timeout; if greater than zero then we poll
for a response from the worker for this many seconds until they
acknowledge the message and stop (only has an effect if |
time_poll |
If |
progress |
Optional logical indicating if a progress bar
should be displayed. If |
controller |
The controller to use. If not given (or |
The type
parameter indicates the strategy used to stop workers,
and interacts with other parameters. The strategies used by the
different values are:
message
, in which case a STOP
message will be sent to the
worker, which they will receive after finishing any currently
running task (if RUNNING
; IDLE
workers will stop immediately).
kill
, in which case a kill signal will be sent via the heartbeat
(if the worker is using one). This will kill the worker even if
is currently working on a task, eventually leaving that task with
a status of DIED
.
kill_local
, in which case a kill signal is sent using operating
system signals, which requires that the worker is on the same
machine as the controller.
The names of the stopped workers, invisibly.
obj <- rrq_controller("rrq:example")
w <- rrq_worker_spawn(controller = obj)
rrq_worker_list(controller = obj)
rrq_worker_stop(w$id, timeout = 10, controller = obj)
rrq_worker_list(controller = obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.