Class: Fluent::GroongaInput::BaseInput
- Inherits:
-
Object
- Object
- Fluent::GroongaInput::BaseInput
- Includes:
- Configurable, DetachMultiProcessMixin
- Defined in:
- lib/fluent/plugin/in_groonga.rb
Constant Summary collapse
- DEFAULT_EMIT_COMMANDS =
[ /\Atable_/, /\Acolumn_/, "load", ]
Instance Method Summary collapse
- #create_repeater(client) ⇒ Object
- #emit(command, params) ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Instance Method Details
#create_repeater(client) ⇒ Object
127 128 129 130 131 |
# File 'lib/fluent/plugin/in_groonga.rb', line 127 def create_repeater(client) repeater = Repeater.connect(@real_host, @real_port, client) repeater.attach(@loop) repeater end |
#emit(command, params) ⇒ Object
133 134 135 136 |
# File 'lib/fluent/plugin/in_groonga.rb', line 133 def emit(command, params) return unless emit_command?(command) Engine.emit("groonga.command.#{command}", Engine.now, params) end |
#shutdown ⇒ Object
120 121 122 123 124 125 |
# File 'lib/fluent/plugin/in_groonga.rb', line 120 def shutdown @loop.stop @socket.close @shutdown_notifier.signal @thread.join end |
#start ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/fluent/plugin/in_groonga.rb', line 102 def start listen_socket = TCPServer.new(@bind, @port) detach_multi_process do @loop = Coolio::Loop.new @socket = Coolio::TCPServer.new(listen_socket, nil, handler_class, self) @loop.attach(@socket) @shutdown_notifier = Coolio::AsyncWatcher.new @loop.attach(@shutdown_notifier) @thread = Thread.new do run end end end |