[Groonga-commit] groonga/fluent-plugin-droonga at eb9e596 [master] Save 'tag' and 'time' to the queue

Back to archive index

Daijiro MORI null+****@clear*****
Thu Apr 18 19:15:13 JST 2013


Daijiro MORI	2013-04-18 19:15:13 +0900 (Thu, 18 Apr 2013)

  New Revision: eb9e596fac76a32ee5d03d6fe7a0f0aa478c987d
  https://github.com/groonga/fluent-plugin-droonga/commit/eb9e596fac76a32ee5d03d6fe7a0f0aa478c987d

  Message:
    Save 'tag' and 'time' to the queue

  Modified files:
    lib/droonga/worker.rb

  Modified: lib/droonga/worker.rb (+9 -9)
===================================================================
--- lib/droonga/worker.rb    2013-04-18 18:11:46 +0900 (aeaa69e)
+++ lib/droonga/worker.rb    2013-04-18 19:15:13 +0900 (f7d47b7)
@@ -61,7 +61,7 @@ module Droonga
       if****@pool*****?
         process_message(record)
       else
-        post_message(record)
+        post_message(tag, time, record)
       end
     end
 
@@ -107,11 +107,11 @@ module Droonga
     end
 
     private
-    def post_message(envelope)
-      message = envelope.to_msgpack
+    def post_message(*message)
+      packed_message = message.to_msgpack
       queue = @context[@queue_name]
       queue.push do |record|
-        record.message = message
+        record.message = packed_message
       end
     end
 
@@ -125,14 +125,14 @@ module Droonga
       end
       queue = @context[@queue_name]
       while !@finish
-        message = nil
+        packed_message = nil
         queue.pull do |record|
           @status = :BUSY
-          message = record.message if record
+          packed_message = record.message if record
         end
-        if message
-          envelope = MessagePack.unpack(message)
-          process_message(envelope) if message
+        if packed_message
+          tag, time, record = MessagePack.unpack(packed_message)
+          process_message(record)
         end
         @status = :IDLE
       end
-------------- next part --------------
HTML����������������������������...
Download 



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