Daijiro MORI
null+****@clear*****
Fri Apr 26 10:20:35 JST 2013
Daijiro MORI 2013-04-26 10:20:35 +0900 (Fri, 26 Apr 2013) New Revision: 5f4837caba959e87020ae04c6b46b597ca9a8c83 https://github.com/groonga/fluent-plugin-droonga/commit/5f4837caba959e87020ae04c6b46b597ca9a8c83 Message: Pass the command and arguments to the receiver. Modified files: lib/droonga/worker.rb Modified: lib/droonga/worker.rb (+8 -7) =================================================================== --- lib/droonga/worker.rb 2013-04-26 10:04:12 +0900 (5712ac1) +++ lib/droonga/worker.rb 2013-04-26 10:20:35 +0900 (33c84c9) @@ -98,10 +98,9 @@ module Droonga synchronous = destination["synchronous"] else receiver = envelope["replyTo"] - is_reply = true end if receiver - output(body, receiver, is_reply) + output(receiver, body, command, arguments) else handler = find_handler(command) if handler @@ -122,19 +121,21 @@ module Droonga add_route(route) if route end - def output(body, receiver, is_reply=false) + def output(receiver, body, command, arguments) output = get_output(receiver) return unless output - if is_reply + if command + message = envelope + message[:body] = body + message[:type] = command + message[:arguments] = arguments + else message = { inReplyTo: envelope["id"], statusCode: 200, type: (envelope["type"] || "") + ".result", body: body } - else - message = envelope - message[:body] = body end output.post("message", message) end -------------- next part -------------- HTML����������������������������... Download