DataSource for C SDK
6.2.20.310828
|
Typedefs | |
typedef void(* | ds_delay_send_cb) (void *context, ds_data_t *dsdata) |
Definition of the callback for sending delayed data. More... | |
typedef struct _ds_delay | ds_delay_t |
The delay channel object type. More... | |
Functions | |
void | ds_delay_data (ds_delay_t *delay, ds_data_t *dsdata) |
Add a data object to a delay channel. More... | |
ds_delay_t * | ds_new_delay (double delay_time, char *prefix, double batch_time) |
Create a new delay channel. More... | |
ds_delay_t * | ds_new_delay_with_callback (double delay_time, char *prefix, double batch_time, void *callback_param, ds_delay_send_cb callback_func) |
Create a new delay channel. More... | |
Delay channels allow programmatic access to created delayed data. Any number of delay channels can be created with ds_new_delay() specifying the delay time and a prefix for the data objects being sent. Then data objects can be sent using ds_delay_data(). The data objects sent will be delayed and they will have the prefix prepended to the subject.
typedef void(* ds_delay_send_cb) (void *context, ds_data_t *dsdata) |
Definition of the callback for sending delayed data.
context | - Supplied callback parameter (given to ds_new_delay_with_callback()) |
dsdata | - Update to publish |
The parameter dsdata should not be freed by this callback function.
typedef struct _ds_delay ds_delay_t |
The delay channel object type.
void ds_delay_data | ( | ds_delay_t * | delay, |
ds_data_t * | dsdata | ||
) |
Add a data object to a delay channel.
delay | The delay channel to use |
dsdata | The data object to delay |
ds_delay_t* ds_new_delay | ( | double | delay_time, |
char * | prefix, | ||
double | batch_time | ||
) |
Create a new delay channel.
delay_time | The number of seconds to delay objects |
prefix | Prefix to be added to the delayed object's name |
batch_time | Frequency in seconds with which batches of updates are sent |
If prefix is NULL then "/delay_time" is used, eg if delay_time is 10 then the prefix will be /10
If batch_time is set to 0 then the value from the configuration option delay-batch-time will be used
Example: Delay objects by 15 minutes and prefix the object names with /DELAYED/OBJ1
ds_delay_t* ds_new_delay_with_callback | ( | double | delay_time, |
char * | prefix, | ||
double | batch_time, | ||
void * | callback_param, | ||
ds_delay_send_cb | callback_func | ||
) |
Create a new delay channel.
delay_time | - The number of seconds to delay objects |
prefix | - Prefix to be added to the delayed object's name |
batch_time | - Frequency in seconds with which batches of updates are sent |
callback_param | - Parameter to specify to the callback function |
callback_func | - Function that is called when an object has been delayed and needs to be sent |
The callback function supplied is called for each update that is due to be sent, this permits any post processing and peer routing control to be performed at sending stage rather than queueing stage. The update supplied to this callback should not be freed.
If prefix is NULL then "/delay_time" is used, eg if delay_time is 10 then the prefix will be /10
If batch_time is set to 0 then the value from the configuration option delay-batch-time will be used
Example: Delay objects by 15 minutes and prefix the object names with /DELAYED/OBJ1