![]() |
Diffusion C API 6.11.5
|
Data Structures | |
struct | diffusion_recoverable_update_stream_callback_response_s |
Structure representing the response for all DIFFUSION_RECOVERABLE_UPDATE_STREAM_T operations. More... | |
struct | diffusion_recoverable_update_stream_params_s |
Structure provided when calling diffusion_recoverable_update_stream_set or diffusion_recoverable_update_stream_validate . More... | |
Typedefs | |
typedef struct DIFFUSION_RECOVERABLE_UPDATE_STREAM_T | DIFFUSION_RECOVERABLE_UPDATE_STREAM_T |
Opaque diffusion recoverable topic update stream struct. | |
typedef struct diffusion_recoverable_update_stream_callback_response_s | DIFFUSION_RECOVERABLE_UPDATE_STREAM_CALLBACK_RESPONSE_T |
Structure representing the response for all DIFFUSION_RECOVERABLE_UPDATE_STREAM_T operations. | |
typedef int(* | RECOVERABLE_UPDATE_STREAM_CALLBACK_HANDLER_T) (const SESSION_T *session, const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream, const DIFFUSION_RECOVERABLE_UPDATE_STREAM_CALLBACK_RESPONSE_T *response, const DIFFUSION_ERROR_T *error, void *context) |
Error handler callback for Recoverable update stream operation. | |
typedef struct diffusion_recoverable_update_stream_params_s | DIFFUSION_RECOVERABLE_UPDATE_STREAM_PARAMS_T |
Structure provided when calling diffusion_recoverable_update_stream_set or diffusion_recoverable_update_stream_validate . | |
Functions | |
bool | diffusion_recoverable_update_stream_set (const SESSION_T *session, const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream, const BUF_T *value, DIFFUSION_RECOVERABLE_UPDATE_STREAM_PARAMS_T params, DIFFUSION_ERROR_T *error) |
Sets the topic to a specified value. | |
DIFFUSION_VALUE_T * | diffusion_recoverable_update_stream_get (const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream, DIFFUSION_ERROR_T *error) |
Return the latest value of the topic set using this update stream. | |
bool | diffusion_recoverable_update_stream_validate (const SESSION_T *session, const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream, DIFFUSION_RECOVERABLE_UPDATE_STREAM_PARAMS_T params, DIFFUSION_ERROR_T *error) |
Validates the update stream. | |
void | diffusion_recoverable_update_stream_free (DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream) |
Free a memory allocated DIFFUSION_RECOVERABLE_UPDATE_STREAM_T | |
bool | diffusion_recoverable_update_stream_is_in_recovery (const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream) |
Indicates if the recoverable update stream is currently recovering from a transient exception. | |
bool | diffusion_recoverable_update_stream_is_error_recoverable (const DIFFUSION_ERROR_T *error) |
Indicates if the error is recoverable by the update stream. | |
void | diffusion_recoverable_update_stream_recover (const SESSION_T *session, const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T *recoverable_update_stream) |
Begins the procedure to attempt recovery from a transient error. | |
void diffusion_recoverable_update_stream_free | ( | DIFFUSION_RECOVERABLE_UPDATE_STREAM_T * | recoverable_update_stream | ) |
Free a memory allocated DIFFUSION_RECOVERABLE_UPDATE_STREAM_T
recoverable_update_stream | The recoverable update stream to be freed. |
DIFFUSION_VALUE_T * diffusion_recoverable_update_stream_get | ( | const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T * | recoverable_update_stream, |
DIFFUSION_ERROR_T * | error | ||
) |
Return the latest value of the topic set using this update stream.
The returned value reflects the last value that has been set, before it is sent to the server.
If the server rejects a set operation, the topic value will not change and this update stream will be invalidated.
diffusion_value_free
should be called on the pointer when no longer needed.
recoverable_update_stream | The stream to get the latest value from. |
error | Populated when an error occurs. |
bool diffusion_recoverable_update_stream_is_error_recoverable | ( | const DIFFUSION_ERROR_T * | error | ) |
Indicates if the error is recoverable by the update stream.
error | The error. |
bool diffusion_recoverable_update_stream_is_in_recovery | ( | const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T * | recoverable_update_stream | ) |
Indicates if the recoverable update stream is currently recovering from a transient exception.
recoverable_update_stream | The recoverable update stream. |
void diffusion_recoverable_update_stream_recover | ( | const SESSION_T * | session, |
const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T * | recoverable_update_stream | ||
) |
Begins the procedure to attempt recovery from a transient error.
session | The session where the recoverable update stream encountered an error. |
recoverable_update_stream | The recoverable update stream that will attempt to recover. |
bool diffusion_recoverable_update_stream_set | ( | const SESSION_T * | session, |
const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T * | recoverable_update_stream, | ||
const BUF_T * | value, | ||
DIFFUSION_RECOVERABLE_UPDATE_STREAM_PARAMS_T | params, | ||
DIFFUSION_ERROR_T * | error | ||
) |
Sets the topic to a specified value.
The NULL
value can only be passed to the value
parameter when updating TOPIC_TYPE_STRING
, TOPIC_TYPE_INT64
or TOPIC_TYPE_DOUBLE
topics.
When a TOPIC_TYPE_STRING
, TOPIC_TYPE_INT64
or TOPIC_TYPE_DOUBLE
topic 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.
This function may fail with the following errors:
DIFF_ERR_INCOMPATIBLE_EXISTING_TOPIC
DIFF_ERR_INVALID_UPDATE_STREAM
DIFF_ERR_NO_SUCH_TOPIC
DIFF_ERR_INVALID_UPDATE_STREAM
DIFF_ERR_ACCESS_DENIED
DIFF_ERR_NO_SESSION
Session no longer exists.
DIFF_ERR_UPDATE_STREAM_RECOVERY_LIMIT_EXCEEDED
DIFF_ERR_CLUSTER_ROUTING
or DIFF_ERR_CLUSTER_REPARTITION
has occurred in the cluster where the server resides. The total amount of retries set by the User has been reached and the update stream has stopped attempting to recover. DIFF_ERR_UNSATISFIED_CONSTRAINT
DIFF_ERR_INVALID_UPDATE_STREAM
session | The session handle. If NULL, this function returns immediately. |
recoverable_update_stream | The update stream to enact the update. |
value | The update value. |
params | Parameters describing a topic update stream set request and callbacks handlers which may be invoked in response. |
error | Populated when an error occurs |
bool diffusion_recoverable_update_stream_validate | ( | const SESSION_T * | session, |
const DIFFUSION_RECOVERABLE_UPDATE_STREAM_T * | recoverable_update_stream, | ||
DIFFUSION_RECOVERABLE_UPDATE_STREAM_PARAMS_T | params, | ||
DIFFUSION_ERROR_T * | error | ||
) |
Validates the update stream.
Update streams are validated lazily when the method diffusion_recoverable_update_stream_set
is called. This function allows the stream to be validated before a value needs to be set.
If the update stream has not been validated yet, calling this function checks the topic exists, the topic type is correct, the constraint is satisfied and the session has permission to update the topic.
Once it has been validated calling this function checks the topic has not been removed, no other stream has been created for the topic, the value of the topic has not been changed by anything else and the session still has permission to update the topic.
This function may fail with the following errors:
DIFF_ERR_INCOMPATIBLE_EXISTING_TOPIC
DIFF_ERR_INVALID_UPDATE_STREAM
DIFF_ERR_NO_SUCH_TOPIC
DIFF_ERR_INVALID_UPDATE_STREAM
DIFF_ERR_ACCESS_DENIED
DIFF_ERR_NO_SESSION
DIFF_ERR_UPDATE_STREAM_RECOVERY_LIMIT_EXCEEDED
DIFF_ERR_CLUSTER_ROUTING
or DIFF_ERR_CLUSTER_REPARTITION
has occurred in the cluster where the server resides. The total amount of retries set by the User has been reached and the update stream has stopped attempting to recover. DIFF_ERR_UNSATISFIED_CONSTRAINT
DIFF_ERR_INVALID_UPDATE_STREAM
session | The session handle. If NULL, this function returns immediately. |
recoverable_update_stream | The update stream to be validated. |
params | Parameters describing a recoverable update stream validate request and callbacks handlers which may be invoked in response. |
error | Populated when an error occurs. |