-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hiredis: Advanced async-handling #983
base: master
Are you sure you want to change the base?
Conversation
@michael-grunder I took #822 (from #638) and decided to match to upstream, I think it's about time community will have access to ASYNC optimizations using the native hiredis client 😄 |
I'm going to merge this but first I need to make sure that the change to I think it's OK but we've had this kind of symbol conflict before (it's why all the sds symbols in hiredis are prefixed with |
async.c
Outdated
while (NULL != (de = dictNext(&it))) \ | ||
pcb = dictGetEntryVal(de); \ | ||
if (pcb) __redisRunCallback(ac,pcb,NULL); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a block here.
while (NULL != (de = dictNext(&it))) \ | |
pcb = dictGetEntryVal(de); \ | |
if (pcb) __redisRunCallback(ac,pcb,NULL); \ | |
while (NULL != (de = dictNext(&it))) { \ | |
pcb = dictGetEntryVal(de); \ | |
if (pcb) __redisRunCallback(ac,pcb,NULL); \ | |
} \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-grunder 👍 good catch, will amend now
088c9ce
to
b393973
Compare
+ hiredis.c: Convert redisSetError to take format and va_args + dict.* : Fixed generic hash function -> cannot really take signed number + async.* : Valdup function now handles OOM properly KeyCompare function uses proper sized integers nextArgument - change to use proper str-int conversion function Added redisAsyncAppend* function family to support buffer optimizations in async-mode Added proper error handling on OOM errors [inc buffer rollback] Review fixes + hiredis.c : Reverted back to memcpy(), will test *printf in different time + aysnc.c : Minor changes for better readability Handle unlikely/pathological OOM conditon cleanly. More OOM checks
b393973
to
44f434c
Compare
KeyCompare function uses proper sized integers
nextArgument - change to use proper str-int conversion function
Added redisAsyncAppend* function family to support buffer
optimizations in async-mode
Added proper error handling on OOM errors [inc buffer rollback]
Review fixes
Handle unlikely/pathological OOM conditon cleanly.
More OOM checks