Diffusion C API  6.3.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Maintaining topic state.

Functions

void diffusion_topic_update_set (SESSION_T *session, DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T params)
 Sets the topic to a specified value. More...
 
void diffusion_topic_update_set_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T params)
 Sets the topic to a specified value. More...
 
void diffusion_topic_update_add_and_set (SESSION_T *session, DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T params)
 Sets the topic to a specified value. More...
 
void diffusion_topic_update_add_and_set_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T params)
 Sets the topic to a specified value. More...
 
DIFFUSION_TOPIC_UPDATE_STREAM_Tdiffusion_topic_update_create_update_stream (SESSION_T *session, const char *topic_path, DIFFUSION_DATATYPE datatype)
 Creates an update strean to use for updating a specific topic. More...
 
DIFFUSION_TOPIC_UPDATE_STREAM_Tdiffusion_topic_update_create_update_stream_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, const char *topic_path, DIFFUSION_DATATYPE datatype)
 Creates an update stream to use for updating a specific topic. More...
 
DIFFUSION_TOPIC_UPDATE_STREAM_Tdiffusion_topic_update_create_update_stream_adding_topic (SESSION_T *session, const char *topic_path, const TOPIC_SPECIFICATION_T *specification, DIFFUSION_DATATYPE datatype, DIFFUSION_TOPIC_UPDATE_STREAM_PARAMS_T params)
 Creates an update stream to use for creating and updating a specific topic. More...
 
DIFFUSION_TOPIC_UPDATE_STREAM_Tdiffusion_topic_update_create_update_stream_adding_topic_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, const char *topic_path, const TOPIC_SPECIFICATION_T *specification, DIFFUSION_DATATYPE datatype, DIFFUSION_TOPIC_UPDATE_STREAM_PARAMS_T params)
 Creates an update stream to use for creating and updating a specific topic. More...
 

Detailed Description

Function Documentation

void diffusion_topic_update_add_and_set ( SESSION_T session,
DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T  params 
)

Sets the topic to a specified value.

If a topic does not exist at params.topic_path, one will be created using the params.specification. If a topic does exist, its specification must match params.specification, otherwise the operation will fail with an error dispatched to params.on_error, if non NULL.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing a topic add and set request and callbacks handlers which may be invoked in response.
void diffusion_topic_update_add_and_set_with_constraint ( SESSION_T session,
const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T constraint,
DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T  params 
)

Sets the topic to a specified value.

If a topic does not exist at params.topic_path, one will be created using the params.specification. If a topic does exist, its specification must match params.specification, otherwise the operation will fail with an error dispatched to params.on_error, if non NULL.

Takes a constraint that must be satisfied for the topic to be created or the update to be applied.

In other respects it works in the same way as diffusion_topic_update_set

Parameters
sessionThe session handle. If NULL, this function returns immediately.
constraintThe conditional constraint to be applied to topic add and set operation
paramsParameters describing a topic add and set request and callbacks handlers which may be invoked in response.
DIFFUSION_TOPIC_UPDATE_STREAM_T* diffusion_topic_update_create_update_stream ( SESSION_T session,
const char *  topic_path,
DIFFUSION_DATATYPE  datatype 
)

Creates an update strean to use for updating a specific topic.

The type of the topic being updated must match the dataype from the params.datatype parameter.

Update streams send a sequence of updates for a specific topic. They take advantage of the sending a sequence of updates to generate and send binary deltas to the server. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.

Streams are validated lazily when the first diffusion_topic_update_stream_set is operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
topic_pathThe path of the topic
datatypeThe topic's datatype
Returns
a memory allocated diffusion topic update stream
DIFFUSION_TOPIC_UPDATE_STREAM_T* diffusion_topic_update_create_update_stream_adding_topic ( SESSION_T session,
const char *  topic_path,
const TOPIC_SPECIFICATION_T *  specification,
DIFFUSION_DATATYPE  datatype,
DIFFUSION_TOPIC_UPDATE_STREAM_PARAMS_T  params 
)

Creates an update stream to use for creating and updating a specific topic.

If a topic does exist, its specification must match specification, otherwise the operation will fail with DIFF_ERR_INCOMPATIBLE_TOPIC being called to the error callback

In other respects this method works in the same way as diffusion_topic_update_create_update_stream.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
topic_pathThe topic path
specificationThe topic's specification
datatypeThe topic's datatype
paramsParameters describing a request to create an update stream
Returns
a memory allocated diffusion topic update stream
DIFFUSION_TOPIC_UPDATE_STREAM_T* diffusion_topic_update_create_update_stream_adding_topic_with_constraint ( SESSION_T session,
const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T constraint,
const char *  topic_path,
const TOPIC_SPECIFICATION_T *  specification,
DIFFUSION_DATATYPE  datatype,
DIFFUSION_TOPIC_UPDATE_STREAM_PARAMS_T  params 
)

Creates an update stream to use for creating and updating a specific topic.

If a topic does exist, its specification must match specification, otherwise the operation will fail with DIFF_ERR_INCOMPATIBLE_TOPIC being called to the error callback.

Takes a constraint that must be satisfied for the update stream to be validated.

In other respects this method works in the same way as diffusion_topic_update_create_update_stream

Parameters
sessionThe session handle. If NULL, this function returns immediately.
constraintThe constraint that must be satisfied for the update stream to be validated
topic_pathThe topic path
specificationThe topic's specification
datatypeThe topic's datatype
paramsParameters describing a request to create an update stream
Returns
a memory allocated diffusion topic update stream
DIFFUSION_TOPIC_UPDATE_STREAM_T* diffusion_topic_update_create_update_stream_with_constraint ( SESSION_T session,
const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T constraint,
const char *  topic_path,
DIFFUSION_DATATYPE  datatype 
)

Creates an update stream to use for updating a specific topic.

Takes a constraint that must be satisfied for the update stream to be validated.

In other respects it works in the same way as diffusion_topic_update_create_update_stream

Parameters
sessionThe session handle. If NULL, this function returns immediately.
constraintThe constraint that must be satisfied for the update stream to be validated
topic_pathThe path of the topic
datatypeThe topic's datatype
Returns
a memory allocated diffusion topic update stream
void diffusion_topic_update_set ( SESSION_T session,
DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T  params 
)

Sets the topic to a specified value.

The NULL value can only be passed to the params.update property when updating DATATYPE_STRING,DATATYPE_INT64 or DATATYPE_DOUBLE topics.

When a topic of type TOPIC_TYPE_STRING, TOPIC_TYPE_INT64 or TOPIC_TYPE_DOUBLE is set to null, the topic will be updated to have no value. If a previous value was present subscribers will receive a notification that the new value is null. New subscribers will not receive a value notification.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing a topic update set request and callbacks handlers which may be invoked in response.
void diffusion_topic_update_set_with_constraint ( SESSION_T session,
const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T constraint,
DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T  params 
)

Sets the topic to a specified value.

Takes a constraint that must be satisfied for the update to be applied.

In other respects it works in the same way as diffusion_topic_update_set

Parameters
sessionThe session handle. If NULL, this function returns immediately.
constraintThe conditional constraint to be applied to topic update set operation
paramsParameters describing a topic update set request and callbacks handlers which may be invoked in response.