[Groonga-commit] droonga/droonga-engine at d4e2966 [master] Call given block directly instead of yield.

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Sep 5 16:54:16 JST 2014


YUKI Hiroshi	2014-09-05 16:54:16 +0900 (Fri, 05 Sep 2014)

  New Revision: d4e2966e0c3cce66afabd30a1ac70d29d38c83dc
  https://github.com/droonga/droonga-engine/commit/d4e2966e0c3cce66afabd30a1ac70d29d38c83dc

  Message:
    Call given block directly instead of yield.
    
    "yield" cannot call given block for this case...

  Modified files:
    lib/droonga/worker_process_agent.rb

  Modified: lib/droonga/worker_process_agent.rb (+3 -5)
===================================================================
--- lib/droonga/worker_process_agent.rb    2014-09-05 16:37:06 +0900 (6c5f0aa)
+++ lib/droonga/worker_process_agent.rb    2014-09-05 16:54:16 +0900 (d9eda53)
@@ -39,14 +39,14 @@ module Droonga
       logger.trace("start: done")
     end
 
-    def stop
+    def stop(&block)
       logger.trace("stop: start")
 
       n_rest_closes = 2
       on_finish = lambda do
         n_rest_closes -= 1
         if n_rest_closes.zero?
-          yield
+          block.call if block.given?
           logger.trace("stop: done")
         end
       end
@@ -56,9 +56,7 @@ module Droonga
         output.write(Messages::FINISH)
         output.on_write_complete do
           output.close
-          on_finish.call do
-            yield
-          end
+          on_finish.call
         end
       else
         on_finish.call
-------------- next part --------------
HTML����������������������������...
Download 



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