- Support for most Redis commands.
- Pub/Sub support.
- No dependencies other than Turbo and Redis.
- Dual turbo.async.task/callback interface for all 'normal' commands
Docs are available on https://enotodden.github.io/turboredis.
local turbo = require("turbo")
local turboredis = require("turboredis")
local yield = coroutine.yield
turbo.ioloop.instance():add_callback(function ()
local redis = turboredis.Connection:new("127.0.0.1", 6379)
local r = yield(redis:connect())
if not r then
print("Could not connect to Redis")
return
end
yield(redis:set("hello", "Hello "))
yield(redis:set("world", "World!"))
print("## " .. yield(redis:get("hello")) .. yield(redis:get("world")))
turbo.ioloop.instance():close()
end)
turbo.ioloop.instance():start()
test.lua
includes basic tests for many of the commands available but
still needs a lot of work.