Couchbase C Client
2.5.6
|
Library destruction routines.
Functions | |
void | lcb_destroy (lcb_t instance) |
Destroy (and release all allocated resources) an instance of lcb. More... | |
lcb_destroy_callback | lcb_set_destroy_callback (lcb_t, lcb_destroy_callback) |
Set the callback to be invoked when the instance is destroyed asynchronously. More... | |
void | lcb_destroy_async (lcb_t instance, const void *arg) |
Asynchronously schedule the destruction of an instance. More... | |
Typedefs | |
typedef void(* | lcb_destroy_callback) (const void *cookie) |
Callback received when instance is about to be destroyed. More... | |
void lcb_destroy | ( | lcb_t | instance | ) |
Destroy (and release all allocated resources) an instance of lcb.
Using instance after calling destroy will most likely cause your application to crash.
Note that any pending operations will not have their callbacks invoked.
instance | the instance to destroy. |
lcb_destroy_callback lcb_set_destroy_callback | ( | lcb_t | , |
lcb_destroy_callback | |||
) |
Set the callback to be invoked when the instance is destroyed asynchronously.
void lcb_destroy_async | ( | lcb_t | instance, |
const void * | arg | ||
) |
Asynchronously schedule the destruction of an instance.
This function provides a safe way for asynchronous environments to destroy the lcb_t handle without worrying about reentrancy issues.
instance | |
arg | a pointer passed to the callback. |
While the callback and cookie are optional, they are very much recommended for testing scenarios where you wish to ensure that all resources allocated by the instance have been closed. Specifically when the callback is invoked, all timers (save for the one actually triggering the destruction) and sockets will have been closed.
As with lcb_destroy() you may call this function only once. You may not call this function together with lcb_destroy as the two are mutually exclusive.
If for whatever reason this function is being called in a synchronous flow, lcb_wait() must be invoked in order for the destruction to take effect
typedef void(* lcb_destroy_callback) (const void *cookie) |
Callback received when instance is about to be destroyed.
cookie | cookie passed to lcb_destroy_async() |