zio-redis
zio-redis copied to clipboard
Implement scripting API
Extracted from this comment authored by @regis-leray.
Commands
- [x] EVAL script numkeys key [key ...] arg [arg ...] Execute a Lua script server side
- [x] EVALSHA sha1 numkeys key [key ...] arg [arg ...] Execute a Lua script server side
- [ ] SCRIPT DEBUG YES|SYNC|NO Set the debug mode for executed scripts.
- [x] SCRIPT EXISTS sha1 [sha1 ...] Check existence of scripts in the script cache.
- [ ] SCRIPT FLUSH Remove all the scripts from the script cache.
- [ ] SCRIPT KILL Kill the script currently in execution.
- [x] SCRIPT LOAD script Load the specified Lua script into the script cache.
Tips
- Define the API in
zio.redis.api
. - Command-specific options should be defined in
zio.redis.options
. - Additional inputs and outputs can be defined in
zio.redis.Input
andzio.redis.Output
, respectively. - Redis API evolves, therefore the commands listed above might be slightly changed. Double check the official docs before starting with implementation.
- Use telnet to understand command protocol details.
- Write inputs and outputs tests in
zio.redis.InputSpec
andzio.redis.OutputSpec
, respectively. - Write integration tests by expanding the
zio.redis.ApiSpec
. - If you feel that the pull request size is growing out of control, feel free to split it but make sure to link this issue in each of the related PRs.
(Partially) implemented by @anatolysergeev in #269
@mijicd, can I work on this one?
All yours!