| Mercury Monitor Reference Manual |
|---|
Command ProcessingCommand Processing — Handling of commands received from consumers |
#include <monitor/producer/commands.h>
prod_cmd;
prod_cmd_collect_args;
prod_cmd_def_ch_args;
prod_cmd_get_args;
prod_cmd_auth_args;
prod_cmd_ctx;
prod_cmd* prod_cmd_new (mon_cmd cmd_code,
uint32_t cmd_seq);
void prod_cmd_free (prod_cmd *cmd);
int prod_cmd_dispatch (prod_cmd *cmd,
prod_conn *conn);
typedef struct {
mon_cmd cmd;
uint32_t cmd_seq;
void (*free_args)(prod_cmd *cmd);
union
{
prod_cmd_collect_args collect;
prod_cmd_get_args stop;
prod_cmd_get_args subscribe;
prod_cmd_get_args buffer;
prod_cmd_get_args get;
prod_cmd_auth_args auth;
prod_cmd_def_ch_args def_ch;
uint32_t set_ch;
uint32_t del_ch;
uint64_t commit;
prod_cmd_collect_args execute;
prod_cmd_collect_args query;
char *wrap;
/* Placeholder marking the size of the union */
uint32_t dummy[3];
} args;
} prod_cmd;
Represents a command received by the producer.
typedef struct {
char *name;
mon_arg_list *arglist;
} prod_cmd_collect_args;
Arguments for COLLECT, QUERY and EXECUTE.
| char *name; | the name of the metric/control. |
| mon_arg_list *arglist; | the arguments for the metric/control. |
typedef struct {
char *url;
mon_arg_list *arglist;
} prod_cmd_def_ch_args;
Arguments for DEF_CHANNEL.
| char *url; | the URL of the channel. |
| mon_arg_list *arglist; | the arguments of the channel. |
typedef struct {
uint32_t metric_id;
uint32_t conn_id;
} prod_cmd_get_args;
Arguments for GET, STOP, SUBSCRIBE and BUFFER.
| uint32_t metric_id; | a metric id. |
| uint32_t conn_id; | the target channel id. |
typedef struct {
char *method;
void *credentials;
uint32_t credlen;
} prod_cmd_auth_args;
Arguments for AUTH.
| char *method; | the authentication method. |
| void *credentials; | opaque credentials. |
| uint32_t credlen; | the length of the credentials. |
typedef struct {
prod_conn *conn;
prod_cmd *cmd;
mon_ctx *ctx;
} prod_cmd_ctx;
Command context used for asynchronous execution.
prod_cmd* prod_cmd_new (mon_cmd cmd_code, uint32_t cmd_seq);
Allocates a new prod_cmd.
| << Actuators | Connections >> |