andyet / thoonk.js

Persistent (and fast!) push feeds, queues, and jobs leveraging Redis
http://thoonk.com
Other
330 stars 27 forks source link

Redis Scripting #12

Open roja opened 12 years ago

roja commented 12 years ago

Would it not be a good idea for thoonk to provide Lua scripts which implement each action for the Redis scripting support? This way a given language implementation is simply calling redis with exec commands, which can be made consistent across differing client implementations. This would have 2 advantages:

  1. Minimise the number of network traversals
  2. Provide atomic consistency for commands
  3. Simplify writing a client library

Or am I barking up the wrong tree?

legastero commented 12 years ago

That actually is the plan! We want to have that done by December for when scripting lands in a stable Redis release.

Work on Lua scripting has started in the scripting branch.

fritzy commented 12 years ago

Just to be clear, we already have atomic consistency, but there's a lot of work we had to do in Node.js to get that to work right, so it'll be nice to get rid of all of that extra code.

Feel free to contribute to our Lua scripting efforts.

sjhewitt commented 12 years ago

I've added lua scripts for the rest of the job contract on my python branch if you want to copy them across to here:

https://github.com/sjhewitt/thoonk.py/commit/9cf058c0501eddae4ca61b2bcceb95f4d5e3e5ab

sjhewitt commented 12 years ago

Create, Config and Delete scripts added here:

https://github.com/sjhewitt/thoonk.py/tree/scripting/scripts

fritzy commented 12 years ago

This is soooo awesome! Thank you so much for your contributions! I aim to spend some time going over it and working more on the lua scripting stuff over the Thanksgiving Holiday.