Last active
August 29, 2015 14:01
-
-
Save franckverrot/1bf6a27be58feb18604a to your computer and use it in GitHub Desktop.
hiredis test
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
/private/tmp/hiredis-rb 691a320 [±] λ rake compile && RUBYLIB=lib ruby -rhiredis test.rb | |
cd tmp/x86_64-darwin13.0/hiredis_ext/2.1.0 | |
make | |
compiling ../../../../ext/hiredis_ext/connection.c | |
linking shared-object hiredis/ext/hiredis_ext.bundle | |
cd - | |
install -c tmp/x86_64-darwin13.0/hiredis_ext/2.1.0/hiredis_ext.bundle lib/hiredis/ext/hiredis_ext.bundle | |
[connection_is_connected is called] | |
true | |
nil | |
"PONG" | |
[connection_is_connected is called] | |
true | |
nil | |
/private/tmp/hiredis-rb/lib/hiredis/ext/connection.rb:19:in `read': Connection reset by peer (Errno::ECONNRESET) | |
from /private/tmp/hiredis-rb/lib/hiredis/ext/connection.rb:19:in `read' | |
from test.rb:9:in `<main>' |
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
conn = Hiredis::Connection.new | |
conn.connect("127.0.0.1", 6379) | |
puts conn.connected? | |
puts conn.write(['PING']).inspect | |
puts conn.read.inspect | |
sleep 4 | |
puts conn.connected? | |
puts conn.write(['PING']).inspect | |
puts conn.read.inspect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment