Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis Lua eval and pubsub - send a command on a message?

Tags:

redis

eval

lua

Is it possible to use lua evaluation to hang out and listen to a pubsub channel, replying with a command on a certain message?

Edit: Seems pubsub has been implemented. I'm a little unclear on how to approach this (lua green). https://github.com/nrk/redis-lua/issues/7

like image 480
JasonG Avatar asked Aug 26 '26 02:08

JasonG


1 Answers

No, subscribe is not allowed in scripts. Scripts are executed in the same event loop as everything else in redis, meaning, while your script is executing no other commands get executed.

Further, the library you are linking to is a lua client library. Here is the relevant documentation for lua scripting in redis.

like image 122
Linus Thiel Avatar answered Aug 27 '26 16:08

Linus Thiel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!