[Groonga-commit] droonga/droonga-engine at 0e75744 [master] serf agent: Accept callback for "stop"

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Apr 20 14:02:26 JST 2015


YUKI Hiroshi	2015-04-20 14:02:26 +0900 (Mon, 20 Apr 2015)

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

  Message:
    serf agent: Accept callback for "stop"

  Modified files:
    lib/droonga/serf/agent.rb

  Modified: lib/droonga/serf/agent.rb (+6 -2)
===================================================================
--- lib/droonga/serf/agent.rb    2015-04-20 11:00:18 +0900 (ae902d4)
+++ lib/droonga/serf/agent.rb    2015-04-20 14:02:26 +0900 (40d88f8)
@@ -58,8 +58,11 @@ module Droonga
         start_ready_check
       end
 
-      def stop
-        return if****@pid*****?
+      def stop(&block)
+        if****@pid*****?
+          yield if block_given?
+          return
+        end
         Process.waitpid(@pid)
         @output_io.close
         # logger.trace("stop: output_io watcher detached",
@@ -68,6 +71,7 @@ module Droonga
         # logger.trace("stop: error_io watcher detached",
         #              :watcher => @error_io)
         @pid = nil
+        yield if block_given?
       end
 
       def running?
-------------- next part --------------
HTML����������������������������...
Télécharger 



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