Kouhei Sutou
null+****@clear*****
Sat Sep 6 00:09:53 JST 2014
Kouhei Sutou 2014-09-06 00:09:53 +0900 (Sat, 06 Sep 2014) New Revision: 9f1e7e8fde3e8e046ea4c155b5d22b22362cd151 https://github.com/droonga/droonga-engine/commit/9f1e7e8fde3e8e046ea4c155b5d22b22362cd151 Message: farm: support graceful stop It is not use thread! Modified files: lib/droonga/farm.rb Modified: lib/droonga/farm.rb (+13 -0) =================================================================== --- lib/droonga/farm.rb 2014-09-06 00:09:40 +0900 (502fbf1) +++ lib/droonga/farm.rb 2014-09-06 00:09:53 +0900 (941add7) @@ -49,6 +49,19 @@ module Droonga end end + def stop_gracefully + n_slices =****@slice***** + n_done_slices = 0 + @slices.each_value do |slice| + slice.stop_gracefully do + n_done_slices += 1 + if n_done_slices == n_slices + yield if block_given? + end + end + end + end + def shutdown threads = [] @slices.each_value do |slice| -------------- next part -------------- HTML����������������������������...Download