library is blocking main thread when connection drops
ppioter opened this issue · 1 comments
ppioter commented
example:
I issue command: redis:ping(), connection drops, it takes around 10s for main thread to resume, are there any workarounds?
it would be nice to have it as non-blocking library, where you could issue
commands like that
local callback=function(event)
local response=event.response
if response=="PONG" then return "pong"
elseif response=="TIMEOUT" then --do time-out-case stuff here --
elseif response=="ERROR" then --do error-case stuff here --
end
end
redis:ping(callback)