diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-29 15:41:03 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-29 15:41:03 +0100 |
commit | 18c55a8f1e93aaa4df6c970333ad3d691e3438b0 (patch) | |
tree | a6482fb7cfd2494394865325d84d91de01a163da /async.h | |
parent | 8cb4d52cd273d6134f881c232a307c3259af334a (diff) |
Scope event library related data and hooks to a struct
Diffstat (limited to 'async.h')
-rw-r--r-- | async.h | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -66,16 +66,18 @@ typedef struct redisAsyncContext { /* Not used by hiredis */ void *data; - /* Used by the different event lib adapters to store their private data */ - void *_adapter_data; - - /* Called when the library expects to start reading/writing. - * The supplied functions should be idempotent. */ - void (*evAddRead)(void *privdata); - void (*evDelRead)(void *privdata); - void (*evAddWrite)(void *privdata); - void (*evDelWrite)(void *privdata); - void (*evCleanup)(void *privdata); + /* Event library data and hooks */ + struct { + void *data; + + /* Hooks that are called when the library expects to start + * reading/writing. These functions should be idempotent. */ + void (*addRead)(void *privdata); + void (*delRead)(void *privdata); + void (*addWrite)(void *privdata); + void (*delWrite)(void *privdata); + void (*cleanup)(void *privdata); + } ev; /* Called when either the connection is terminated due to an error or per * user request. The status is set accordingly (REDIS_OK, REDIS_ERR). */ |