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.



11
12
13
14
15
16
# File 'lib/fluent/plugin/in_storm.rb', line 11

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

Instance Method Details

#configure(conf) ⇒ Object



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

def configure(conf)
  super
end

#runObject



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

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

#shutdownObject



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

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

#startObject



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

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