Class: Fluent::StormInput

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

Defined Under Namespace

Classes: TimerWatcher

Instance Method Summary collapse

Constructor Details

#initializeStormInput

Returns a new instance of StormInput.



16
17
18
19
20
21
# File 'lib/fluent/plugin/in_storm.rb', line 16

def initialize
  super
  require 'net/http'
  require 'uri'
  require 'json'
end

Instance Method Details

#configure(conf) ⇒ Object



23
24
25
# File 'lib/fluent/plugin/in_storm.rb', line 23

def configure(conf)
  super
end

#runObject



40
41
42
43
44
45
# File 'lib/fluent/plugin/in_storm.rb', line 40

def run
  @loop.run
rescue => e
  @log.error 'unexpected error', error: e.to_s
  @log.error_backtrace
end

#shutdownObject



34
35
36
37
38
# File 'lib/fluent/plugin/in_storm.rb', line 34

def shutdown
  @tw.detach
  @loop.stop
  @thread.join
end

#startObject



27
28
29
30
31
32
# File 'lib/fluent/plugin/in_storm.rb', line 27

def start
  @loop = Coolio::Loop.new
  @tw = TimerWatcher.new(interval, true, log, &method(:execute))
  @tw.attach(@loop)
  @thread = Thread.new(&method(:run))
end