Class: Fluent::StormInput
- Inherits:
-
Input
- Object
- Input
- Fluent::StormInput
- Defined in:
- lib/fluent/plugin/in_storm.rb
Defined Under Namespace
Classes: TimerWatcher
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ StormInput
constructor
A new instance of StormInput.
- #run ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ StormInput
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 |
#run ⇒ Object
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 |
#shutdown ⇒ Object
29 30 31 32 33 |
# File 'lib/fluent/plugin/in_storm.rb', line 29 def shutdown @tw.detach @loop.stop @thread.join end |
#start ⇒ Object
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 |