smax-clib v0.9
A C/C++ client library for SMA-X
|
This module adds trusty push delivery to SMA-X. If the server cannot be reached, push requests are stored and updated locally until the server connection is restored, at which point they are delivered. More...
Functions | |
boolean | smaxIsResilient () |
void | smaxSetResilient (boolean value) |
void | smaxSetResilientExit (boolean value) |
This module adds trusty push delivery to SMA-X. If the server cannot be reached, push requests are stored and updated locally until the server connection is restored, at which point they are delivered.
This way, push requests are guaranteed to make it to the database sooner or later as long as the calling program keeps running.
It's mainly useful for daemons that generate infrequent data for the database. It's not especially meaningful for simple executables, which are run for limited time without persistence.
boolean smaxIsResilient | ( | ) |
Checks whether the resiliency feature has been enabled.
void smaxSetResilient | ( | boolean | value | ) |
Enables the resiliency feature of the library, which keeps track of local changes destined to the database when the database is not reachable, and sending all locally stored updates once the database comes online again. However, after sending all pending updates to the remote server, the program may exit (default behavior), unless smaxSetResilientExit() is set to FALSE (0), so that it can be restarted in a fresh state, setting up subscriptions and scripts again as necessary.
value | TRUE (non-zero) to enable, or FALSE (0) to disable resiliency. |
References FALSE, smaxAddConnectHook(), smaxRemoveConnectHook(), TRUE, and xvprintf.
void smaxSetResilientExit | ( | boolean | value | ) |
Sets whether the program should exit in resilient mode, after having pushed all local updates. The default is to exit since the reconnecting in resilient mode does not by itself re-establish existing subscriptions. However, when subscriptions aren't used, or if they are set up as a connect hook, the user may want the program to simply continue. This is possible by passing FALSE (0) as the argument to this call. This setting only takes effect when resilient mode is enabled. Otherwise, the exit policy is set by the RedisX library.
value | Whether to exit the program after all local updates have been pushed to SMA-X after a recovering from an outage. |