worker_loop_callr {rush} | R Documentation |
Single Task Worker Loop with callr Encapsulation
Description
Worker loop that pops a single task from the queue, executes the function in an external callr session and pushes the results. Supports timeouts on the tasks.
Usage
worker_loop_callr(fun, constants = NULL, rush)
Arguments
fun |
( |
constants |
( |
rush |
(RushWorker) |
Value
NULL
Examples
# This example is not executed since Redis must be installed
config_local = redux::redis_config()
rush = rsh(network_id = "test_network", config = config_local)
fun = function(x1, x2, ...) list(y = x1 + x2)
rush$start_local_workers(
fun = fun,
worker_loop = worker_loop_callr)
rush$stop_workers()
[Package rush version 0.1.1 Index]