Couchbase C Client  2.4.4
Unlocking items.

Detailed Description

See Get items from the cluster.

Functions

lcb_unlock_callback lcb_set_unlock_callback (lcb_t, lcb_unlock_callback)
 
lcb_error_t lcb_unlock (lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_unlock_cmd_t *const *commands)
 Unlock the key locked with lcb_get() with the lcb_GETCMDv0::lock option. More...
 

Typedefs

typedef void(* lcb_unlock_callback )(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp)
 The callback function for an unlock request. More...
 

Function Documentation

lcb_unlock_callback lcb_set_unlock_callback ( lcb_t  ,
lcb_unlock_callback   
)
Stability
Committed:
lcb_error_t lcb_unlock ( lcb_t  instance,
const void *  command_cookie,
lcb_SIZE  num,
const lcb_unlock_cmd_t *const *  commands 
)

Unlock the key locked with lcb_get() with the lcb_GETCMDv0::lock option.

You should initialize the key, nkey and cas member in the lcb_item_st structure for the keys to get. All other members should be set to zero.

lcb_unlock_cmd_t *unlock = calloc(1, sizeof(*unlock));
unlock->version = 0;
unlock->v.v0.key = "my-key";
unlock->v.v0.nkey = strlen(unlock->v.v0.key);
unlock->v.v0.cas = 0x666;
lcb_unlock_cmd_t* commands[] = { unlock };
lcb_unlock(instance, NULL, 1, commands);
Parameters
instancethe handle to lcb
command_cookieA cookie passed to all of the notifications from this command
numthe total number of elements in the commands array
commandsthe array containing the items to unlock
Returns
The status of the operation
Stability
Committed:

Data Structure Documentation

struct lcb_UNLOCKCMDv0

lcb_unlock() Command structure

See also
lcb_GETRESPv0
Data Fields
const void * key
lcb_SIZE nkey
lcb_cas_t cas You must populate this with the CAS.
struct lcb_unlock_cmd_t

lcb_unlock() Wrapper structure

See also
lcb_UNLOCKCMDv0
Data Fields
int version
union lcb_unlock_cmd_t v
struct lcb_UNLOCKRESPv0

lcb_unlock() response structure

Data Fields
const void * key
lcb_SIZE nkey
struct lcb_unlock_resp_t

lcb_unlock() wrapper response structure

See also
lcb_UNLOCKRESPv0
Data Fields
int version
union lcb_unlock_resp_t v

Typedef Documentation

typedef void(* lcb_unlock_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp)

The callback function for an unlock request.

Parameters
instancethe instance performing the operation
cookiethe cookie associated with with the command
errorThe status of the operation
respMore information about the operation
Stability
Committed: