YUKI Hiroshi
null+****@clear*****
Tue Apr 14 20:12:55 JST 2015
YUKI Hiroshi 2015-04-14 20:12:55 +0900 (Tue, 14 Apr 2015) New Revision: b6f6aa554526abbd9ace491fd3f9f7053141492d https://github.com/droonga/droonga-client-ruby/commit/b6f6aa554526abbd9ace491fd3f9f7053141492d Message: Shorten Modified files: lib/droonga/client/connection/droonga-protocol/thread.rb Modified: lib/droonga/client/connection/droonga-protocol/thread.rb (+6 -5) =================================================================== --- lib/droonga/client/connection/droonga-protocol/thread.rb 2015-04-14 20:09:15 +0900 (1b7703a) +++ lib/droonga/client/connection/droonga-protocol/thread.rb 2015-04-14 20:12:55 +0900 (2b2369f) @@ -78,8 +78,9 @@ module Droonga message["from"] = receive_end_point send(message, options) + timeout_seconds = options[:timeout_seconds] receive_options = { - :timeout => options[:timeout_seconds], + :timeout => timeout_seconds, } start = Time.new sync = block.nil? @@ -89,8 +90,8 @@ module Droonga receiver.receive(receive_options) do |object| yielder << object end - if receive_options[:timeout] and - Time.new - start > receive_options[:timeout] + if timeout_seconds and + Time.new - start > timeout_seconds break end end @@ -101,8 +102,8 @@ module Droonga begin loop do receiver.receive(receive_options, &block) - if receive_options[:timeout] and - Time.new - start > receive_options[:timeout] + if timeout_seconds and + Time.new - start > timeout_seconds break end end -------------- next part -------------- HTML����������������������������...다운로드