Can you use Lua scripting to make Redis throw events?

By : fancy
Source: Stackoverflow.com
Question!

I'm trying to create an abstraction where I can listen to change events of a redis collection and have the key, value passed into a callback. I was wondering if it would be possible to do this with Lua scripting on the newer versions.

Thanks!

By : fancy


Answers

No, you can't.

Since Redis is single threaded, your lua script must return quickly. Listening to change of events requires a long running process, and lua scripting is just not designed for that use case.

Take a look at my answer to your other question - listen for changes in redis



This video can help you solving your question :)
By: admin