$ show openresty/lua-resty-redis
lua-resty-redis is a Lua Redis client driver for OpenResty/ngx_lua, leveraging the cosocket API for fully non-blocking I/O. It implements the Redis wire protocol (RESP) to support all standard Redis commands, including pipelining, transactions, pub/sub, and SSL connections. The library provides automatic method generation via Lua metatables, allowing any Redis command to be called as a method without explicit registration. It also offers connection pooling, Unix socket support, and configurable timeouts. The single source file (lib/resty/redis.lua) is self-contained and can be dropped into any OpenResty project. The codebase demonstrates strong engineering practices with efficient table reuse, proper error handling, and comprehensive test coverage.
The LLM identified 1 files worth highlighting for reuse:
The entire Redis client library. It implements the Redis protocol over cosocket, with automatic command method generation via __index metatable, efficient request building using table concatenation, and a table pool for reuse. It supports pipelining, transactions, pub/sub, SSL, and connection pooling. This is a self-contained, production-ready component that can be reused in any OpenResty project requiring Redis access.