[Groonga-commit] droonga/droonga-client-ruby at efaea3d [master] Return all messages by Receiver#receive

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Oct 28 20:16:54 JST 2013


YUKI Hiroshi	2013-10-28 20:16:54 +0900 (Mon, 28 Oct 2013)

  New Revision: efaea3d4a6469853767da48443bb891934bdbd29
  https://github.com/droonga/droonga-client-ruby/commit/efaea3d4a6469853767da48443bb891934bdbd29

  Message:
    Return all messages by Receiver#receive

  Modified files:
    lib/droonga/client/connection/droonga_protocol.rb

  Modified: lib/droonga/client/connection/droonga_protocol.rb (+4 -5)
===================================================================
--- lib/droonga/client/connection/droonga_protocol.rb    2013-10-24 18:34:10 +0900 (03c3c11)
+++ lib/droonga/client/connection/droonga_protocol.rb    2013-10-28 20:16:54 +0900 (b97ab52)
@@ -53,7 +53,7 @@ module Droonga
             envelope = envelope.dup
             envelope["replyTo"] = "#{receiver.host}:#{receiver.port}/droonga"
             @logger.post("message", envelope)
-            receiver.receive(:timeout => @timeout)
+            receiver.receive(:timeout => @timeout).first
           ensure
             receiver.close
           end
@@ -84,14 +84,13 @@ module Droonga
           def receive(options={})
             if IO.select([@socket], nil, nil, options[:timeout])
               client =****@socke*****
-              response = nil
+              messages = []
               unpacker = MessagePack::Unpacker.new(client)
               unpacker.each do |object|
-                response = object
-                break
+                messages << object
               end
               client.close
-              response
+              messages
             else
               nil
             end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index