EventMachine::Connection
# File lib/redis/connection/synchrony.rb, line 23 def connected? @connected end
# File lib/redis/connection/synchrony.rb, line 18 def connection_completed @connected = true succeed end
# File lib/redis/connection/synchrony.rb, line 12 def post_init @req = nil @connected = false @reader = ::Hiredis::Reader.new end
# File lib/redis/connection/synchrony.rb, line 45 def read @req = EventMachine::DefaultDeferrable.new EventMachine::Synchrony.sync @req end
# File lib/redis/connection/synchrony.rb, line 27 def receive_data(data) @reader.feed(data) loop do begin reply = @reader.gets rescue RuntimeError => err @req.fail [:error, ProtocolError.new(err.message)] break end break if reply == false reply = CommandError.new(reply.message) if reply.is_a?(RuntimeError) @req.succeed [:reply, reply] end end
Generated with the Darkfish Rdoc Generator 2.