You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Lua uses cooperative multitasking and is single-threaded in most environments, libraries like LuaSocket depend heavily on timeouts and doing small batches of work at a time.
As a Redis subscriber, I have a similar requirement, and want to receive notifications within a function call that has a max-runtime duration budget. So I set a LuaSocket timeout:
client.network.socket:settimeout(0.25)
formessage, abortinclient:pubsub({subscribe=topics}) do-- Handle message and abortif (myelapsedtimebudgetisup) thenreturnendend
But the client library is currently unforgiving of LuaSocket timeout errors and treats them like a hard failure:
lua: .///mytestfile.lua:46: /usr/local/share/lua/5.2/redis.lua:271: attempt to index local 'payload' (a nil value)
The text was updated successfully, but these errors were encountered:
Since Lua uses cooperative multitasking and is single-threaded in most environments, libraries like LuaSocket depend heavily on timeouts and doing small batches of work at a time.
As a Redis subscriber, I have a similar requirement, and want to receive notifications within a function call that has a max-runtime duration budget. So I set a LuaSocket timeout:
But the client library is currently unforgiving of LuaSocket timeout errors and treats them like a hard failure:
The text was updated successfully, but these errors were encountered: