[Groonga-commit] droonga/fluent-plugin-droonga at a062803 [master] Benchmark: add method to create message for subscribing via droogna protocol

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Oct 28 18:21:13 JST 2013


YUKI Hiroshi	2013-10-28 18:21:13 +0900 (Mon, 28 Oct 2013)

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

  Message:
    Benchmark: add method to create message for subscribing via droogna protocol

  Modified files:
    benchmark/utils.rb

  Modified: benchmark/utils.rb (+35 -0)
===================================================================
--- benchmark/utils.rb    2013-10-28 18:01:45 +0900 (245ab7f)
+++ benchmark/utils.rb    2013-10-28 18:21:13 +0900 (d670185)
@@ -163,4 +163,39 @@ module DroongaBenchmark
      (PADDING * (SIZE / PADDING.size)) + keyword
     end
   end
+
+  class MessageCreator
+    class << self
+      def envelope_to_subscribe(term, route=nil)
+        message = {
+          "id" => Time.now.to_f.to_s,
+          "date" => Time.now,
+          "statusCode" => 200,
+          "type" => "watch.subscribe",
+          "body" => {
+            "condition" => keyword,
+            "subscriber" => "subscriber for #{keyword}",
+          },
+        }
+        unless route.nil?
+          message["body"]["route"] = route
+        end
+        message
+      end
+
+      def envelope_to_feed(keyword)
+        {
+          "id" => Time.now.to_f.to_s,
+          "date" => Time.now,
+          "statusCode" => 200,
+          "type" => "watch.feed",
+          "body" => {
+            "targets" => {
+              "keyword"  => keyword,
+            },
+          },
+        }
+      end
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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