Created
December 3, 2012 10:20
-
-
Save matsumotory/4194067 to your computer and use it in GitHub Desktop.
redis by mod_mruby
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
r = Apache::Request.new() | |
r.content_type = "text/html" | |
a = Apache | |
host = "127.0.0.1" | |
port = 6379 | |
a.rputs("> redis connect " + host + ":" + port.to_s + "<br>") | |
redis = Apache::Redis.new(host, port) | |
key="hoge" | |
val="aaaaaaaaaaaaaa" | |
a.rputs("> redis set " + key + " " + val + "<br>") | |
redis.set(key, val) | |
a.rputs("> redis get " + key + "<br>") | |
Apache.rputs(key + ": " + redis.get(key)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment