[Groonga-commit] droonga/droonga-engine at ee0e271 [master] Add utility method to send Serf events and queries

Back to archive index

YUKI Hiroshi null+****@clear*****
Sat Jun 28 00:21:29 JST 2014


YUKI Hiroshi	2014-06-28 00:21:29 +0900 (Sat, 28 Jun 2014)

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

  Message:
    Add utility method to send Serf events and queries

  Modified files:
    lib/droonga/serf.rb

  Modified: lib/droonga/serf.rb (+14 -0)
===================================================================
--- lib/droonga/serf.rb    2014-06-28 00:20:56 +0900 (e1897c7)
+++ lib/droonga/serf.rb    2014-06-28 00:21:29 +0900 (bf9b8c0)
@@ -15,6 +15,8 @@
 
 require "English"
 
+require "json"
+
 require "droonga/path"
 require "droonga/loggable"
 require "droonga/catalog_loader"
@@ -53,6 +55,18 @@ module Droonga
         end
         {}
       end
+
+      def send_event(name, event, payload)
+        serf = new(nul, name)
+        serf.run("event", JSON.generate(payload))
+        serf.shutdown
+      end
+
+      def send_query(name, query, payload)
+        serf = new(nul, name)
+        serf.run("query", JSON.generate(payload))
+        serf.shutdown
+      end
     end
 
     include Loggable
-------------- next part --------------
HTML����������������������������...
Download 



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