[Groonga-commit] droonga/drndump at c5a1974 [master] Add callback entry point to monitor progress

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Apr 15 17:36:22 JST 2015


YUKI Hiroshi	2015-04-15 17:36:22 +0900 (Wed, 15 Apr 2015)

  New Revision: c5a1974d534a5376280bc6f65c5ffdcadc36ac0d
  https://github.com/droonga/drndump/commit/c5a1974d534a5376280bc6f65c5ffdcadc36ac0d

  Message:
    Add callback entry point to monitor progress

  Modified files:
    lib/drndump/dump_client.rb

  Modified: lib/drndump/dump_client.rb (+3 -1)
===================================================================
--- lib/drndump/dump_client.rb    2015-04-15 13:25:16 +0900 (2205984)
+++ lib/drndump/dump_client.rb    2015-04-15 17:36:22 +0900 (b4b7a07)
@@ -20,7 +20,7 @@ require "droonga/client"
 module Drndump
   class DumpClient
     attr_reader :error_message
-    attr_writer :on_finish
+    attr_writer :on_finish, :on_progress
 
     def initialize(params)
       @host     = params[:host]
@@ -34,6 +34,7 @@ module Drndump
       @error_message = nil
 
       @on_finish = nil
+      @on_progress = nil
     end
 
     def run(options={}, &block)
@@ -52,6 +53,7 @@ module Drndump
         "body"    => dump_params,
       }
       client.subscribe(dump_message) do |message|
+        @on_progress.call(message) if @on_progress
         case message
         when Droonga::Client::Error
           client.close
-------------- next part --------------
HTML����������������������������...
Download 



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