Class: Fluent::ResqueStatInput
- Inherits:
-
Input
- Object
- Input
- Fluent::ResqueStatInput
- Defined in:
- lib/fluent/plugin/in_resque_stat.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ ResqueStatInput
constructor
A new instance of ResqueStatInput.
- #run_resque_stat ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ ResqueStatInput
Returns a new instance of ResqueStatInput.
5 6 7 8 |
# File 'lib/fluent/plugin/in_resque_stat.rb', line 5 def initialize super require 'resque' end |
Instance Method Details
#configure(conf) ⇒ Object
15 16 17 18 |
# File 'lib/fluent/plugin/in_resque_stat.rb', line 15 def configure(conf) super Resque.redis = "#{@host}:#{@port}" end |
#run_resque_stat ⇒ Object
30 31 32 33 34 35 |
# File 'lib/fluent/plugin/in_resque_stat.rb', line 30 def run_resque_stat until @finished sleep @run_interval resque_each_line end end |
#shutdown ⇒ Object
25 26 27 28 |
# File 'lib/fluent/plugin/in_resque_stat.rb', line 25 def shutdown @finished = true @thread.join end |
#start ⇒ Object
20 21 22 23 |
# File 'lib/fluent/plugin/in_resque_stat.rb', line 20 def start @finished = false @thread = Thread.new(&method(:run_resque_stat)) end |