Skip to content

Lssikkes/turboredis

 
 

Repository files navigation

turboredis

Redis library for Turbo

  • 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

Documentation

Docs are available on https://enotodden.github.io/turboredis.


Example:

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()

Tests:

test.lua includes basic tests for many of the commands available but still needs a lot of work.

Releases

No releases published

Packages

No packages published

Languages

  • Lua 99.6%
  • Shell 0.4%