worker_loop_default {rush}R 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()


[Package rush version 0.1.1 Index]