[Groonga-commit] droonga/droonga-engine at 169f12a [master] Revert "Make Deferrable module to accept multiple "on_ready" callbacks"

アーカイブの一覧に戻る

YUKI Hiroshi null+****@clear*****
Tue Apr 21 13:00:27 JST 2015


YUKI Hiroshi	2015-04-21 13:00:27 +0900 (Tue, 21 Apr 2015)

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

  Message:
    Revert "Make Deferrable module to accept multiple "on_ready" callbacks"
    
    This reverts commit e8e0e23ecf1a5336baf2a4bfaac2a79de8e41929.
    Because it is too complex.

  Modified files:
    lib/droonga/deferrable.rb

  Modified: lib/droonga/deferrable.rb (+2 -16)
===================================================================
--- lib/droonga/deferrable.rb    2015-04-21 12:29:56 +0900 (1977c52)
+++ lib/droonga/deferrable.rb    2015-04-21 13:00:27 +0900 (2b0dee4)
@@ -15,7 +15,7 @@
 
 module Droonga
   module Deferrable
-    attr_writer :on_failure
+    attr_writer :on_ready, :on_failure
 
     def wait_until_ready(target)
       target.on_ready = lambda do
@@ -23,23 +23,9 @@ module Droonga
       end
     end
 
-    def on_ready=(callback)
-      @on_ready_callbacks ||= []
-      if callback
-        @on_ready_callbacks << callback
-      else
-        @on_ready_callbacks.clear
-      end
-      callback
-    end
-
     private
     def on_ready
-      if @on_ready_callbacks
-        @on_ready_callbacks.each do |callback|
-          callback.call
-        end
-      end
+      @on_ready.call if @on_ready
     end
 
     def on_failure
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る