206 const void *param,
const size_t len_param);
527nmsg_io_get_stats(nmsg_io_t
io, uint64_t *sum_in, uint64_t *sum_out, uint64_t *container_recvs, uint64_t *container_drops);
nmsg_res(* nmsg_filter_message_fp)(nmsg_message_t *msg, void *user, nmsg_filter_message_verdict *vres)
Function pointer type for a function that performs message filtering.
nmsg_filter_message_verdict
void nmsg_io_set_atstart_fp(nmsg_io_t io, nmsg_io_user_fp user_fp, void *user)
Set a user-specified function to be called in each thread after the thread starts.
nmsg_res nmsg_io_get_stats(nmsg_io_t io, uint64_t *sum_in, uint64_t *sum_out, uint64_t *container_recvs, uint64_t *container_drops)
Get counters of input and output payloads and containers received and dropped since the start of nmsg...
void nmsg_io_set_interval_randomized(nmsg_io_t io, bool randomized)
Configure the nmsg_io_t object to randomize the initial second within the interval where it closes in...
nmsg_res nmsg_io_add_filter_module(nmsg_io_t io, const char *name, const void *param, const size_t len_param)
Add a filter module to the filter chain.
nmsg_res nmsg_io_loop(nmsg_io_t io)
Begin processing the data specified by the configured inputs and outputs.
void nmsg_io_set_atexit_fp(nmsg_io_t io, nmsg_io_user_fp user_fp, void *user)
Set a user-specified function to be called in each thread before the thread exits.
void nmsg_io_set_filter_policy(nmsg_io_t io, const nmsg_filter_message_verdict policy)
Set the filter policy for the nmsg_io_t object's filter chain.
void nmsg_io_breakloop(nmsg_io_t io)
Force a currently executing nmsg_io_loop() to stop looping and return.
nmsg_res nmsg_io_add_filter(nmsg_io_t io, nmsg_filter_message_fp fp, void *data)
Add a user-specified filter function to the filter chain.
nmsg_res nmsg_io_add_output(nmsg_io_t io, nmsg_output_t output, void *user)
Add an nmsg output to an nmsg_io_t object.
void nmsg_io_set_interval(nmsg_io_t io, unsigned interval)
Configure the nmsg_io_t object to close inputs periodically, every #interval seconds.
void(* nmsg_io_user_fp)(unsigned threadno, void *user)
Optional user-specified function to be run at thread start or thread stop.
nmsg_res nmsg_io_add_input_zmq_channel(nmsg_io_t io, void *zmq_ctx, const char *chan, void *user)
Add an nmsg ZMQ input channel to an nmsg_io_t object.
nmsg_io_io_type
Type of the stream associated with a close event.
@ nmsg_io_io_type_output
close event output
@ nmsg_io_io_type_input
close event input
nmsg_io_close_type
Type of a close event notification.
@ nmsg_io_close_type_interval
interval elapsed
@ nmsg_io_close_type_count
payload count reached
@ nmsg_io_close_type_eof
end of file
void nmsg_io_set_count(nmsg_io_t io, unsigned count)
Configure the nmsg_io_t object to close inputs after processing a certain non-zero number of payloads...
void nmsg_io_destroy(nmsg_io_t *io)
Deallocate the resources associated with an nmsg_io_t object.
nmsg_res nmsg_io_add_input_fname(nmsg_io_t io, const char *fname, void *user)
Add an NMSG file to an nmsg_io_t object.
unsigned nmsg_io_get_num_outputs(nmsg_io_t io)
Get the number of outputs bound to the nmsg_io_t object.
void nmsg_io_set_close_fp(nmsg_io_t io, nmsg_io_close_fp close_fp)
Set the close event notification function associated with an nmsg_io_t object.
void(* nmsg_io_close_fp)(struct nmsg_io_close_event *ce)
Function for handling close event notifications.
nmsg_io_t nmsg_io_init(void)
Initialize a new nmsg_io_t object.
nmsg_res nmsg_io_add_input_sockspec(nmsg_io_t io, const char *sockspec, void *user)
Add an nmsg input sockspec to an nmsg_io_t object.
void nmsg_io_set_output_mode(nmsg_io_t io, nmsg_io_output_mode output_mode)
Set the output mode behavior for an nmsg_io_t object.
void nmsg_io_set_debug(nmsg_io_t io, int debug)
Set the debug level for an nmsg_io_t object.
nmsg_res nmsg_io_add_input_channel(nmsg_io_t io, const char *chan, void *user)
Add an nmsg input channel to an nmsg_io_t object.
nmsg_io_output_mode
Output behavior when multiple outputs are present.
@ nmsg_io_output_mode_mirror
mirror payloads across output
@ nmsg_io_output_mode_stripe
stripe payloads across output
nmsg_res nmsg_io_add_input(nmsg_io_t io, nmsg_input_t input, void *user)
Add an nmsg input to an nmsg_io_t object.
unsigned nmsg_io_get_num_inputs(nmsg_io_t io)
Get the number of inputs bound to the nmsg_io_t object.
Write nmsg containers to output streams.
nmsg_output_type
An enum identifying the underlying implementation of an nmsg_output_t object.
Structure for passing information about a close event between the nmsg_io processing loop and the ori...
nmsg_output_type output_type
type of 'output' field
void * user
caller-provided user pointer
nmsg_io_t io
this nmsg_io loop
nmsg_input_type input_type
type of 'input' field
nmsg_input_t * input
pointer to input stream
nmsg_output_t * output
pointer to output stream
nmsg_io_close_type close_type
why the stream was closed
nmsg_io_io_type io_type
whether 'input' or 'output'