-
-
Save abiank/5019736 to your computer and use it in GitHub Desktop.
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
# Step 0 -- create test data | |
redis-cli HSET :object:30343552:data foo bar | |
# Step 1 -- store sample function 'sampleFunction' | |
redis-cli SET :functions:sample "redis.call('SELECT', 0);local data=redis.call('HGETALL',':object:' .. ARGV[1] .. ':data');return data" | |
# Step 2 -- create function loader | |
redis-cli SCRIPT LOAD "f=loadstring(redis.call('get',':functions:' .. KEYS[1]));return f()" | |
# Step 3 -- test | |
redis-cli EVALSHA 7b951bb1cb58cb9de1dee3cb6f79fb089911ff8f 1 sampleFunction 30343552 | |
# have fun :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment