Skip to content

Instantly share code, notes, and snippets.

@franckverrot
Last active August 29, 2015 14:01
Show Gist options
  • Save franckverrot/1bf6a27be58feb18604a to your computer and use it in GitHub Desktop.
Save franckverrot/1bf6a27be58feb18604a to your computer and use it in GitHub Desktop.
hiredis test
/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>'
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