Skip to content
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

Allow alternative coroutine implementations #41

Open
wants to merge 4 commits into
base: version-2.0
Choose a base branch
from
Open

Allow alternative coroutine implementations #41

wants to merge 4 commits into from

Conversation

saucisson
Copy link

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:

Alban Linard added 2 commits November 28, 2014 11:10
This test is very simple, as it only checks that the `coroutine` parameter
is passed to the client. Checking that the used alternative coroutine
implementation works is out of its scope.
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) are caught by iterators,
instead of the scheduler.
@nrk
Copy link
Owner

nrk commented Nov 28, 2014

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!

@saucisson
Copy link
Author

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.

@pounard
Copy link

pounard commented Nov 22, 2015

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants