worker_loop_default: Single Task Worker Loop

View source: R/worker_loops.R

worker_loop_defaultR Documentation

Single Task Worker Loop

Description

Worker loop that pops a single task from the queue, executes the function and pushes the results.

Usage

worker_loop_default(fun, constants = NULL, rush)

Arguments

fun

(function)
Function to be executed.

constants

(list)
List of constants passed to fun.

rush

(RushWorker)
Rush worker instance.

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_default)

   rush$stop_workers()


rush documentation built on Sept. 11, 2024, 9:15 p.m.