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.
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 |
#run ⇒ Object
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 |
#shutdown ⇒ Object
34 35 36 37 38 |
# File 'lib/fluent/plugin/in_storm.rb', line 34 def shutdown @tw.detach @loop.stop @thread.join end |
#start ⇒ Object
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 |