Class: RulesIO::GirlFridayQueue
- Inherits:
-
GirlFriday::WorkQueue
- Object
- GirlFriday::WorkQueue
- RulesIO::GirlFridayQueue
- Includes:
- Singleton
- Defined in:
- lib/rulesio/girl_friday_queue.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ GirlFridayQueue
constructor
A new instance of GirlFridayQueue.
Constructor Details
#initialize ⇒ GirlFridayQueue
Returns a new instance of GirlFridayQueue.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rulesio/girl_friday_queue.rb', line 9 def initialize super(:rulesio, {:size => 1}.merge(RulesIO.)) do |msg| retries = 0 begin RulesIO.post_payload_to_token msg[:payload], msg[:token] rescue Exception => e if (retries += 1) % 6 == 5 RulesIO.logger.warn "RulesIO having trouble sending events; #{retries} attempts so far." RulesIO.logger.warn "#{e.inspect}: #{e.}" end sleep [5, retries].max retry end RulesIO.logger.warn "RulesIO resuming service after #{retries} retries." unless retries == 0 end end |
Class Method Details
.push(*args) ⇒ Object
26 27 28 |
# File 'lib/rulesio/girl_friday_queue.rb', line 26 def self.push *args instance.push *args end |
.status ⇒ Object
30 31 32 |
# File 'lib/rulesio/girl_friday_queue.rb', line 30 def self.status instance.status end |