memcache/request.h
changeset 41 540737bf6bac
parent 39 0e21a65074a6
child 42 0e503189af2f
equal deleted inserted replaced
40:9cecd22e643a 41:540737bf6bac
     8 
     8 
     9 struct memcache_req {
     9 struct memcache_req {
    10     // the memcache context that we belong to
    10     // the memcache context that we belong to
    11     struct memcache *mc;
    11     struct memcache *mc;
    12 
    12 
       
    13     // the command to execute
       
    14     enum memcache_command cmd_type;
       
    15 
    13     // our key/obj
    16     // our key/obj
    14     struct memcache_key key;
    17     struct memcache_key key;
    15     struct memcache_obj *obj;
    18     struct memcache_obj obj;
       
    19     struct memcache_buf buf;
    16 
    20 
    17     // our state
    21     // our state
    18     enum memcache_req_state state;
    22     enum memcache_req_state state;
    19 
    23 
    20     // our user callback argument
    24     // our user callback argument
    28 };
    32 };
    29 
    33 
    30 /*
    34 /*
    31  * Allocate and return a new req, or NULL if unsuccesfull.
    35  * Allocate and return a new req, or NULL if unsuccesfull.
    32  */
    36  */
    33 struct memcache_req *memcache_req_alloc (struct memcache *mc, struct memcache_key *key, void *cb_arg);
    37 struct memcache_req *memcache_req_alloc (struct memcache *mc, enum memcache_command cmd_type, const struct memcache_key *key, void *cb_arg);
    34 
    38 
    35 
    39 
    36 /*
    40 /*
    37  * An error occurred, and the request must be abandoned. This will assume that the req is not active or enqueued
    41  * An error occurred, and the request must be abandoned. This will assume that the req is not active or enqueued
    38  * anymore, and the req should not be accessed by memcache_* code after this.
    42  * anymore, and the req should not be accessed by memcache_* code after this.