Class: Fluent::RelpInput
- Inherits:
-
Input
- Object
- Input
- Fluent::RelpInput
- Defined in:
- lib/fluent/plugin/in_relp.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #on_message(msg) ⇒ Object
- #run ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Instance Method Details
#configure(conf) ⇒ Object
15 16 17 |
# File 'lib/fluent/plugin/in_relp.rb', line 15 def configure(conf) super end |
#on_message(msg) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/fluent/plugin/in_relp.rb', line 37 def (msg) time = Engine.now router.emit(@tag, time, msg.dump) rescue => e log.error msg.dump, error: e, error_class: e.class log.error_backtrace end |
#run ⇒ Object
30 31 32 33 34 35 |
# File 'lib/fluent/plugin/in_relp.rb', line 30 def run @server.run() rescue => e log.error "unexpected error", error: e, error_class: e.class log.error_backtrace end |
#shutdown ⇒ Object
24 25 26 27 28 |
# File 'lib/fluent/plugin/in_relp.rb', line 24 def shutdown super @server.server_shut_down @thread.join end |
#start ⇒ Object
19 20 21 22 |
# File 'lib/fluent/plugin/in_relp.rb', line 19 def start @server = Relp::RelpServer.new(@bind, @port, log, method(:on_message)) @thread = Thread.new(&method(:run)) end |