[Groonga-commit] droonga/droonga-engine at cf555db [master] dump: send dump.end message at the end

Back to archive index

Kouhei Sutou null+****@clear*****
Fri May 2 18:29:17 JST 2014


Kouhei Sutou	2014-05-02 18:29:17 +0900 (Fri, 02 May 2014)

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

  Message:
    dump: send dump.end message at the end

  Modified files:
    lib/droonga/plugins/dump.rb

  Modified: lib/droonga/plugins/dump.rb (+11 -1)
===================================================================
--- lib/droonga/plugins/dump.rb    2014-05-02 18:26:55 +0900 (f9fb7e5)
+++ lib/droonga/plugins/dump.rb    2014-05-02 18:29:17 +0900 (383fe50)
@@ -26,6 +26,8 @@ module Droonga
 
       class Handler < Droonga::Handler
         def handle(message)
+          id = message.raw["id"]
+          dataset = message.raw["dataset"]
           replyTo = (message.raw["replyTo"] || {})["to"]
           return false unless replyTo
 
@@ -42,7 +44,8 @@ module Droonga
                   values[key] = value unless key.start_with?("_")
                 end
                 dump_message = {
-                  "dataset" => message.raw["dataset"],
+                  "inReplyTo" => id,
+                  "dataset" => dataset,
                   "body" => {
                     "table" => table.name,
                     "key" => record.key,
@@ -56,6 +59,13 @@ module Droonga
                 Fiber.yield if n.zero?
               end
             end
+            dump_end_message = {
+              "inReplyTo" => id,
+              "dataset" => dataset,
+            }
+            messenger.forward(dump_end_message,
+                              "to" => replyTo,
+                              "type" => "dump.end")
           end
 
           timer = Coolio::TimerWatcher.new(0.1, true)
-------------- next part --------------
HTML����������������������������...
Download 



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