sendMessage: A function that takes the required information for a job and...

Description Usage Arguments Details

View source: R/sendMessage.R

Description

sendMessage takes the required inputs for a request job, bundles them into the correct format, and ships them off to the queue.

Usage

1
2
3
sendMessage(conn, jobsQueue = "jobsQueue", package, func, ...,
  resultsQueue = "resultsQueue", errorQueue = "errorQueue",
  useJSON = F)

Arguments

conn

An open redux hiredis connection.

jobsQueue

A string giving the name of the queue where jobs will be placed. Defaults to jobsqueue.

package

A string giving the name of the package containing the function to execute.

func

The name of the function in package to execute.

...

All parameters to be passed to func.

resultsQueue

A string giving the name of the queue to send results to. Defaults to "resultsQueue".

errorQueue

A string giving the name of the queue to send errors to. Defaults to "errorQueue".

useJSON

Flag specifying whether jobs and results will be sent in JSON format. Defaults to false

Details

package is the name of the package containing the function that will be executed.

func is the name of the function, contained in the specified package, that you wish to execute with this request. If useJSON is false, func can take any type of parameter. If useJSON is true, then func should only take R data as parameters that can be converted to and from JSON, i.e. strings, numbers, simple vectors, etc.

parameters is a named list of all the parameters to be passed to func. The names must match those of the parameters func expects.

resultsQueue will be a string with the name of the redis queue to store any returned results in. Returned results will have a status property set to "succeeded" and a results property containing the results of the function execution. Defaults to "resultsQueue".

errorQueue will be a string with the name of the redis queue to store any errors thrown while running the job. Note that returned errors will have status "failed" or "catastrophic", so errorQueue can match resultsQueue and you can separate message types by checking their status.


PieceMaker/RMinions documentation built on Oct. 21, 2019, 8:01 p.m.