YUKI Hiroshi
null+****@clear*****
Tue Oct 29 18:42:47 JST 2013
YUKI Hiroshi 2013-10-29 18:42:47 +0900 (Tue, 29 Oct 2013) New Revision: 59303276805bcd82a9df14fa219a3c35ba84bf7d https://github.com/droonga/fluent-plugin-droonga/commit/59303276805bcd82a9df14fa219a3c35ba84bf7d Message: MessageReceiver#receive should return only one message Modified files: benchmark/utils.rb benchmark/watch/benchmark-notify.rb Modified: benchmark/utils.rb (+4 -5) =================================================================== --- benchmark/utils.rb 2013-10-29 18:41:05 +0900 (f09d1a2) +++ benchmark/utils.rb 2013-10-29 18:42:47 +0900 (5a5111d) @@ -223,17 +223,16 @@ module DroongaBenchmark end def receive(options={}) - waiting_count = options[:wait_for] || 1 if IO.select([@socket], nil, nil, options[:timeout]) client =****@socke***** - messages = [] + message = nil unpacker = MessagePack::Unpacker.new(client) unpacker.each do |object| - messages << object - break if messages.size >= waiting_count + message = object + break end client.close - messages + message else nil end Modified: benchmark/watch/benchmark-notify.rb (+2 -1) =================================================================== --- benchmark/watch/benchmark-notify.rb 2013-10-29 18:41:05 +0900 (cb68b11) +++ benchmark/watch/benchmark-notify.rb 2013-10-29 18:42:47 +0900 (54d462f) @@ -61,7 +61,8 @@ class NotifyBenchmark @n_times.times do |index| do_feed("#{WATCHING_KEYWORD} #{index}") end - received =****@recei*****(:timeout => @timeout, :wait_for => @n_times) + received = [] + received << @receiver.receive(:timeout => @timeout) notifications += received if received.is_a?(Array) notifications end -------------- next part -------------- HTML����������������������������...Download