Couchbase C Client  2.4.4
Modify an item's expiration time

Detailed Description

Modify an item's expiration time, keeping it alive without modifying it.

Functions

lcb_touch_callback lcb_set_touch_callback (lcb_t, lcb_touch_callback)
 
lcb_error_t lcb_touch (lcb_t instance, const void *cookie, lcb_SIZE num, const lcb_touch_cmd_t *const *commands)
 Touch (set expiration time) on a number of values in the cache. More...
 

Typedefs

typedef lcb_get_cmd_t lcb_touch_cmd_t
 
typedef void(* lcb_touch_callback )(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp)
 The callback function for a touch request. More...
 

Function Documentation

lcb_touch_callback lcb_set_touch_callback ( lcb_t  ,
lcb_touch_callback   
)
Stability
Committed:
lcb_error_t lcb_touch ( lcb_t  instance,
const void *  cookie,
lcb_SIZE  num,
const lcb_touch_cmd_t *const *  commands 
)

Touch (set expiration time) on a number of values in the cache.

Values larger than 30*24*60*60 seconds (30 days) are interpreted as absolute times (from the epoch). All other members should be set to zero.

Example
lcb_touch_cmd_t touch = { 0 };
lcb_touch_cmd_t *cmdlist = { &touch; }
touch->v.v0.key = "my-key";
touch->v.v0.nkey = strlen(item->v.v0.key);
touch->v.v0.exptime = 300; // 5 minutes
lcb_touch(instance, NULL, 1, cmdlist);
Parameters
instancethe instance used to batch the requests from
cookieA cookie passed to all of the notifications from this command
numthe total number of elements in the commnands array
commandsthe array containing the items to touch
Returns
The status of the operation

Typedef Documentation

typedef void(* lcb_touch_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp)

The callback function for a touch 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: