Created
October 24, 2010 04:24
-
-
Save agladysh/643089 to your computer and use it in GitHub Desktop.
HKEYS is broken
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' | |
local tstr = import 'lua-nucleo/tstr.lua' { 'tstr' } -- Lua value to string | |
local N = 1 | |
local P = function(...) print(N .. ":", tstr(assert(...))); N = N + 1 end | |
-------------------------------------------------------------------------------- | |
-- Connect to Redis | |
-------------------------------------------------------------------------------- | |
local R = assert(sidereal.connect("localhost", 6379)) | |
-------------------------------------------------------------------------------- | |
-- Fill data | |
-------------------------------------------------------------------------------- | |
assert(R:hset("MYHASH", "one", 1)) | |
assert(R:hset("MYHASH", "two", 2)) | |
-------------------------------------------------------------------------------- | |
-- This works | |
-------------------------------------------------------------------------------- | |
P (R:hkeys("MYHASH")) | |
--> 1: {"one","two"} | |
-------------------------------------------------------------------------------- | |
-- This does not | |
-------------------------------------------------------------------------------- | |
R:pipeline() | |
P (R:hkeys("MYHASH")) | |
--> 2: {} | |
R:send_pipeline() | |
P (R:get_response()) | |
--> 3: true | |
-------------------------------------------------------------------------------- | |
-- This does not either | |
-------------------------------------------------------------------------------- | |
P (R:multi()) | |
--> 4: "OK" | |
P (R:hkeys("MYHASH")) | |
--> 5: "QUEUED" | |
P (R:exec()) | |
--> 6: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment