Class: Fluent::RelpInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_relp.rb

Instance Method Summary collapse

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 on_message(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

#runObject



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

#shutdownObject



24
25
26
27
28
# File 'lib/fluent/plugin/in_relp.rb', line 24

def shutdown
  super
  @server.server_shut_down
    @thread.join
end

#startObject



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