Nyx Node
Loading...
Searching...
No Matches
Nyx Stream Message
Collaboration diagram for Nyx Stream Message:

Functions

nyx_dict_tnyx_stream_prop_new (STR_t name, __NYX_NULLABLE__ STR_t label)
 Allocates a new Nyx Stream property.
nyx_dict_tnyx_stream_vector_new (STR_t device, STR_t name, nyx_state_t state, nyx_dict_t *props[], __NYX_NULLABLE__ const nyx_opts_t *opts)
 Allocates a new Nyx Stream vector.
bool nyx_stream_pub (const nyx_dict_t *vector, __NYX_ZEROABLE__ size_t n_fields, const size_t field_sizes[], const buff_t field_buffs[])
 If Nyx Stream is enabled, publishes an entry to a stream.

Detailed Description

Nyx Stream Message

Function Documentation

◆ nyx_stream_prop_new()

nyx_dict_t * nyx_stream_prop_new ( STR_t name,
__NYX_NULLABLE__ STR_t label )

Allocates a new Nyx Stream property.

Parameters
nameProperty name.
labelProperty label.
Returns
The new property object.
Note
If the property name ends with .b, the payload is automatically Base64-encoded.
If the property name ends with .z, the payload is automatically ZLib-compressed.

◆ nyx_stream_vector_new()

nyx_dict_t * nyx_stream_vector_new ( STR_t device,
STR_t name,
nyx_state_t state,
nyx_dict_t * props[],
__NYX_NULLABLE__ const nyx_opts_t * opts )

Allocates a new Nyx Stream vector.

Parameters
deviceDevice name.
nameVector name.
stateVector state.
propsArray of properties with NULL sentinel.
optsOptions (group, label, hints, timeout, message).
Returns
The new vector object.

◆ nyx_stream_pub()

bool nyx_stream_pub ( const nyx_dict_t * vector,
__NYX_ZEROABLE__ size_t n_fields,
const size_t field_sizes[],
const buff_t field_buffs[] )

If Nyx Stream is enabled, publishes an entry to a stream.

Parameters
vectorNyx stream vector.
n_fieldsNumber of fields. Must match the number of properties in the vector.
field_sizesArray of payload byte counts, one per field.
field_buffsArray of payload buffers, one per field.
Returns
true if the provided fields match the vector content, false otherwise.
Note
Field payloads may contain arbitrary binary data.