Modules | |
Extract messages to a JSON string | |
Extract messages to a C structure | |
Data Structures | |
struct | RF_FARM_REPLY |
The structure of all JSON message payloads received from the RIP farm. More... | |
Typedefs | |
typedef int | RF_MSG_TYPE |
A limited range integer containing message numbers from the documentation. | |
typedef struct RF_PAYLOAD | RF_PAYLOAD |
An opaque handle to a message payload received from the RIP farm. | |
typedef struct RF_FARM_REPLY | RF_FARM_REPLY |
The structure of all JSON message payloads received from the RIP farm. More... | |
typedef HqBool() | message_callback_fn(void *args, RF_FARM_REPLY farm_reply) |
The signature of the message_callback() function passed to rf_iface_start(). More... | |
Enumerations | |
enum | RF_MSG_TYPES { RF_FARM_STARTING = 11 , RF_FARM_STOPPING = 21 , RF_BLADE_STOPPING = 27 , RF_CONFIG_CONSTRUCTED = 41 , RF_CONFIG_DELETED = 43 , RF_CONFIG_STATUS = 45 , RF_JOB_REQUEST = 51 , RF_JOB_STARTING = 53 , RF_JOB_CANCELLING = 55 , RF_JOB_PAUSING = 57 , RF_JOB_RESUMING = 59 , RF_JOB_PAUSED = 62 , RF_JOB_RESUMED = 63 , RF_RASTER_CONNECTED = 133 , RF_RASTER_DISCONNECTED = 135 , RF_RASTERS_AVAILABLE = 125 , RF_RASTER_DELIVER = 127 , RF_FARM_STATUS = 101 , RF_JOB_STATUS = 103 , RF_RIP_STATUS = 105 , RF_BLADE_STATUS = 107 , RF_RASTER_STATUS = 131 , RF_FARM_STARTED = 12 , RF_FARM_STOPPED = 22 , RF_FARM_STOP_PROGRESS = 28 , RF_JOB_STARTED = 61 , RF_JOB_COMPLETED = 60 , RF_RASTER_PROGRESS = 136 } |
Values for RF_MSG_TYPE, passed to message_callback_fn in the RF_FARM_REPLY::msg_type field. The values of the assignments match the design docs. More... | |
Functions | |
void | rf_free_payload (RF_PAYLOAD **payload) |
Free the payload of a message received from the RIP farm. More... | |
Messages from the RIP farm are passed in the first instance to the customer written message_callback() function which receives the JSON message in an encoded form. There are two methods of decoding, to a JSON string and to a C structure. The method of choice will probably depend on the programming language in which a DFE client is written, and its support for JSON.
The functions for receiving messages from the RIP farm are spread amongst these functional groups:
The first four of these contain the messages replying to a request from the DFE. The latter are notifications that an action initiated by an earlier transaction has completed.
typedef HqBool() message_callback_fn(void *args, RF_FARM_REPLY farm_reply) |
The signature of the message_callback() function passed to rf_iface_start().
The message_callback() function is customer code running in the DFE Interface reactor thread. It should therefore execute quickly or the reactor will block. Ideally it will simply pass farm_reply in a message to a separate thread.
args | The opaque value passed through unchanged from the message_callback_args param to rf_iface_start(). |
farm_reply | Contains the JSON message structure defined in the documentation. |
TRUE
normally. If successful, farm_reply.payload should be freed by message_callback() or a proxy, with rf_free_payload() when it is no longer required. If there were non-critical errors, these should be transmitted to the DFE client by methods internal to message_callback().FALSE
return is a catastrophic error that will result in shutting down the DFE Interface. typedef struct RF_FARM_REPLY RF_FARM_REPLY |
The structure of all JSON message payloads received from the RIP farm.
All messages are received via the message_callback parameter to rf_iface_start().
enum RF_MSG_TYPES |
Values for RF_MSG_TYPE, passed to message_callback_fn in the RF_FARM_REPLY::msg_type field. The values of the assignments match the design docs.
Enumerator | |
---|---|
RF_FARM_STARTING | Immediate reply to rf_send_farm_start() with payload RF_REPLY_FARM_STARTING. |
RF_FARM_STOPPING | Immediate reply to rf_send_farm_stop() with payload RF_REPLY_FARM_STOPPING. |
RF_BLADE_STOPPING | Immediate reply to rf_send_blade_stop() with payload RF_REPLY_BLADE_STOPPING. |
RF_JOB_STARTING | Immediate reply to rf_send_job_start() with payload RF_REPLY_JOB_STARTING. |
RF_JOB_CANCELLING | Immediate reply to rf_send_job_cancel() with payload RF_REPLY_JOB_CANCELLING. |
RF_JOB_PAUSING | Immediate reply to rf_send_job_pause() with payload RF_REPLY_JOB_PAUSING. |
RF_JOB_RESUMING | Immediate reply to rf_send_job_resume() with payload RF_REPLY_JOB_RESUMING. |
RF_JOB_PAUSED | Notification that a job has paused with payload RF_REPLY_JOB_PAUSED. |
RF_JOB_RESUMED | Notification that a job has resumed with payload RF_REPLY_JOB_RESUMED. |
RF_RASTER_CONNECTED | Immediate reply to rf_send_raster_connect() with payload RF_REPLY_RASTER_CONNECTED. |
RF_RASTER_DISCONNECTED | Immediate reply to rf_send_raster_disconnect() with payload RF_REPLY_RASTER_DISCONNECTED. |
RF_RASTERS_AVAILABLE | Eventual and repeated reply to rf_send_raster_connect() to indicate that rasters are available with payload RF_REPLY_RASTERS_AVAILABLE. |
RF_RASTER_DELIVER | Eventual reply to rf_send_raster_request() with payload RF_REPLY_RASTER_DELIVER. |
RF_JOB_STATUS | Immediate reply to rf_send_job_status_request() with payload RF_REPLY_JOB_STATUS. |
RF_RIP_STATUS | Immediate reply to rf_send_rip_status_request() with payload RF_REPLY_RIP_STATUS. |
RF_BLADE_STATUS | Immediate reply to rf_send_blade_status_request() with payload RF_REPLY_BLADE_STATUS. |
RF_RASTER_STATUS | Immediate reply to rf_send_raster_status_request() with payload RF_REPLY_RASTER_STATUS. |
RF_FARM_STARTED | Notification that the RIP farm has started. |
RF_FARM_STOPPED | Notification that the RIP farm has stopped with payload RF_REPLY_FARM_STOPPED. |
RF_FARM_STOP_PROGRESS | Notification that the RIP farm is stopping with payload RF_REPLY_FARM_STOP_PROGRESS. |
RF_JOB_STARTED | Notification that a job has started with payload RF_REPLY_JOB_STARTED. |
RF_JOB_COMPLETED | Notification that a job has completed with payload RF_REPLY_JOB_COMPLETED. |
RF_RASTER_PROGRESS | Notification that rasters have been produced or consumed with payload RF_REPLY_RASTER_PROGRESS. |
void rf_free_payload | ( | RF_PAYLOAD ** | payload | ) |
Free the payload of a message received from the RIP farm.
This must be called when the payload is no longer needed.
[in,out] | payload | Object to be freed. Safe against NULL *payload, which is always set to NULL on return. |