sendResponse: A function that takes a connection, a location, a status, and...

Description Usage Arguments Details

View source: R/sendResponse.R

Description

sendResponse takes the required inputs for a response, formats them appropriately, and then sends the response.

Usage

1
2
sendResponse(conn, queue, status = c("succeeded", "failed",
  "catastrophic"), job, response, useJSON = F)

Arguments

conn

An open redux hiredis connection.

queue

A string giving the name of the queue where the response will be sent.

status

One of the following strings: "succeeded", "failed", or "catastrophic".

job

The job that was used to generate 'result'.

response

The result of executing the job.

useJSON

Flag specifying whether messages are in JSON format. Defaults to false.

Details

The response that will be sent back is the original 'job' with the addition of the 'status' property and one of the following two properties: 'error' or 'results'. If 'status' is either 'failed' or 'catastrophic', then 'response' will be placed in the 'error' property. If 'status' is 'succeeded' then 'response' will be placed in the 'response' property.

The 'failed' status should be used when the error occurred while executing the job and was handled. The 'catastrophic' status should be used whenever an unhandled error that trips the final try-catch occurs.


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