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
38 39 40 41 42 43 44 45 |
# File 'lib/fluent/plugin/in_relp.rb', line 38 def (msg) time = Engine.now record = {"message"=> msg} router.emit(@tag, time, record) rescue => e log.error msg.dump, error: e, error_class: e.class log.error_backtrace end |
#run ⇒ Object
31 32 33 34 35 36 |
# File 'lib/fluent/plugin/in_relp.rb', line 31 def run @server.run() rescue => e log.error "unexpected error", error: e, error_class: e.class log.error_backtrace end |
#shutdown ⇒ Object
25 26 27 28 29 |
# File 'lib/fluent/plugin/in_relp.rb', line 25 def shutdown super @server.server_shutdown @thread.join end |
#start ⇒ Object
19 20 21 22 23 |
# File 'lib/fluent/plugin/in_relp.rb', line 19 def start super @server = Relp::RelpServer.new(@bind, @port, log, method(:on_message)) @thread = Thread.new(&method(:run)) end |