[Groonga-commit] droonga/droonga-engine at 394b3e8 [master] Simplify

Back to archive index

YUKI Hiroshi yuki****@clear*****
Thu Apr 23 13:03:12 JST 2015


なんと……なんでこんな書き方?と思ったら、前はそれでないと動かなかったんで
すね。
(手元のcool.ioが既に新しいバージョンだったので、実装の方を見ても分かっ
ていませんでした)

Kouhei Sutou wrote:
>> -        on_readable = lambda do
>> -          receive_heartbeat
>> -        end
>>           @watcher.on_readable do
>> -          on_readable.call
>> +          receive_heartbeat
>>           end
> 
> 実は、これが動くようになったのはCool.io 1.3.0からなんですよ。
> 
> https://github.com/tarcieri/cool.io/blob/master/CHANGES.md
> 
>> 
>    Block evaluation doesn't change self for keeping
>    consistency with Ruby block
> 
> がそれです。
> 
> なので、Cool.ioの要求バージョンを1.3.0以降にしておいてもらえ
> ますか?
> 
> In <394b3e813cd35cb7810b320491d6f2fc8929a505 �� jenkins.clear-code.com>
>    "[Groonga-commit] droonga/droonga-engine �� 394b3e8 [master] Simplify" on Wed, 22 Apr 2015 16:25:07 +0900,
>    YUKI Hiroshi <null+groonga �� clear-code.com> wrote:
> 
>> YUKI Hiroshi	2015-04-22 16:25:07 +0900 (Wed, 22 Apr 2015)
>>
>>    New Revision: 394b3e813cd35cb7810b320491d6f2fc8929a505
>>    https://github.com/droonga/droonga-engine/commit/394b3e813cd35cb7810b320491d6f2fc8929a505
>>
>>    Message:
>>      Simplify
>>
>>    Modified files:
>>      lib/droonga/fluent_message_receiver.rb
>>
>>    Modified: lib/droonga/fluent_message_receiver.rb (+3 -12)
>> ===================================================================
>> --- lib/droonga/fluent_message_receiver.rb    2015-04-22 15:43:24 +0900 (4b2cd00)
>> +++ lib/droonga/fluent_message_receiver.rb    2015-04-22 16:25:07 +0900 (0dc6705)
>> @@ -141,11 +141,8 @@ module Droonga
>>           @socket = UDPSocket.for_fd(@fd)
>>   
>>           @watcher = Coolio::IOWatcher.new(@socket, "r")
>> -        on_readable = lambda do
>> -          receive_heartbeat
>> -        end
>>           @watcher.on_readable do
>> -          on_readable.call
>> +          receive_heartbeat
>>           end
>>           @loop.attach(@watcher)
>>           # logger.trace("start: new heartbeat watcher attached",
>> @@ -199,20 +196,14 @@ module Droonga
>>           @on_close = nil
>>           @unpacker = MessagePack::Unpacker.new
>>   
>> -        on_read = lambda do |data|
>> -          feed(data)
>> -        end
>>           @io.on_read do |data|
>> -          on_read.call(data)
>> +          feed(data)
>>           end
>>   
>> -        on_close = lambda do
>> +        @io.on_close do
>>             @io = nil
>>             @on_close.call if @on_close
>>           end
>> -        @io.on_close do
>> -          on_close.call
>> -        end
>>         end
>>   
>>         def close
> 
> _______________________________________________
> Groonga-commit mailing list
> Groonga-commit �� lists.sourceforge.jp
> http://lists.sourceforge.jp/mailman/listinfo/groonga-commit
> 

-- 
結城 洋志 <YUKI Hiroshi>
E-mail: yuki �� clear-code.com

株式会社クリアコード
〒170-0005 東京都豊島区南大塚3-29-9
           中野ビル3階
TEL : 03-5927-9440
FAX : 03-5927-9441
WWW : http://www.clear-code.com/




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