Kouhei Sutou
null+****@clear*****
Fri Feb 7 15:31:23 JST 2014
Kouhei Sutou 2014-02-07 15:31:23 +0900 (Fri, 07 Feb 2014) New Revision: 4765cff1b541a42c2bbd5be92feac3878af36f41 https://github.com/droonga/fluent-plugin-droonga/commit/4765cff1b541a42c2bbd5be92feac3878af36f41 Message: Add "Runner" suffix Modified files: lib/droonga/processor.rb lib/droonga/worker.rb Renamed files: lib/droonga/handler_runner.rb (from lib/droonga/handler.rb) Renamed: lib/droonga/handler_runner.rb (+1 -1) 99% =================================================================== --- lib/droonga/handler.rb 2014-02-07 15:27:06 +0900 (fa7ef03) +++ lib/droonga/handler_runner.rb 2014-02-07 15:31:23 +0900 (38c0a87) @@ -22,7 +22,7 @@ require "droonga/legacy_pluggable" require "droonga/handler_plugin" module Droonga - class Handler + class HandlerRunner include LegacyPluggable attr_reader :context, :name Modified: lib/droonga/processor.rb (+8 -10) =================================================================== --- lib/droonga/processor.rb 2014-02-07 15:27:06 +0900 (3c3118f) +++ lib/droonga/processor.rb 2014-02-07 15:31:23 +0900 (a893c9f) @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2013 Droonga Project +# Copyright (C) 2013-2014 Droonga Project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -15,7 +13,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -require "droonga/handler" +require "droonga/handler_runner" module Droonga class Processor @@ -27,24 +25,24 @@ module Droonga end def start - @handler = Handler.new(@loop, @options) - @handler.start + @handler_runner = HandlerRunner.new(@loop, @options) + @handler_runner.start end def shutdown $log.trace("#{log_tag}: shutdown: start") - @handler.shutdown + @handler_runner.shutdown $log.trace("#{log_tag}: shutdown: done") end def process(message) $log.trace("#{log_tag}: process: start") command = message["type"] - if****@handl*****?(command) + if @handler_runner.processable?(command) $log.trace("#{log_tag}: process: handlable: #{command}") - synchronous =****@handl*****_synchronous?(command) + synchronous = @handler_runner.prefer_synchronous?(command) if @n_workers.zero? or synchronous - @handler.process(message) + @handler_runner.process(message) else @message_pusher.push(message) end Modified: lib/droonga/worker.rb (+7 -8) =================================================================== --- lib/droonga/worker.rb 2014-02-07 15:27:06 +0900 (5087455) +++ lib/droonga/worker.rb 2014-02-07 15:31:23 +0900 (8e96452) @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2013 Droonga Project +# Copyright (C) 2013-2014 Droonga Project # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -16,14 +14,15 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require "droonga/event_loop" -require "droonga/handler" +require "droonga/handler_runner" require "droonga/message_receiver" module Droonga module Worker def initialize @loop = EventLoop.new - @handler = Handler.new(@loop, config.merge(:dispatcher => nil)) + @handler_runner = HandlerRunner.new(@loop, + config.merge(:dispatcher => nil)) receiver_socket = config[:message_receiver] @message_receiver = MessageReceiver.new(@loop, receiver_socket) do |message| process(message) @@ -32,10 +31,10 @@ module Droonga def run $log.trace("#{log_tag}: run: start") - @handler.start + @handler_runner.start @message_receiver.start @loop.run - @handler.shutdown + @handler_runner.shutdown $log.trace("#{log_tag}: run: done") end @@ -49,7 +48,7 @@ module Droonga private def process(message) $log.trace("#{log_tag}: process: start") - @handler.process(message) + @handler_runner.process(message) $log.trace("#{log_tag}: process: done") end -------------- next part -------------- HTML����������������������������...Download