redis-lua icon indicating copy to clipboard operation
redis-lua copied to clipboard

Allow alternative coroutine implementations

Open saucisson opened this issue 11 years ago • 3 comments

This is required when using redis-lua within scheduled coroutines, for instance with copas. When using the standard coroutine implementation, yields from the network operations (receive, send) can be caught by the iterators of redis-lua, instead of the scheduler.

This patch works together with the construction of a client from a socket: copas wrapped sockets can be given to redis-lua.

Below are links to:

saucisson avatar Nov 28 '14 10:11 saucisson

Thanks @saucisson, I'm very interested in your PR but unfortunately I won't be able to review or even try your changes at least until the 2nd week of December as I'm leaving tomorrow and will be overseas until then. In the meanwhile feel free to push new changes if needed.

Thanks!

nrk avatar Nov 28 '14 10:11 nrk

The alternative coroutine implementation (https://github.com/saucisson/lua-coronest) has just been released as a rock (https://rocks.moonscript.org/modules/saucisson/coronest), and documented a bit more, and can now be installed easily if needed.

saucisson avatar Jan 14 '15 15:01 saucisson

@saucisson I'd be curious to know why are you doing this ? I do have a specific need: use a nginx specific API to attempt to maintain the connection to redis persistent, because doing a reconnect on each HTTP query in order to do my access checks is way too slow.

pounard avatar Nov 22 '15 21:11 pounard