Class: WhenAUser::GirlFridayQueue
- Inherits:
-
GirlFriday::WorkQueue
- Object
- GirlFriday::WorkQueue
- WhenAUser::GirlFridayQueue
- Includes:
- Singleton
- Defined in:
- lib/whenauser/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 |
# File 'lib/whenauser/girl_friday_queue.rb', line 9 def initialize super(:whenauser, {:size => 1}.merge(WhenAUser.)) do |msg| retries = 0 begin WhenAUser.post_payload_to_token msg[:payload], WhenAUser.token rescue Exception => e if (retries += 1) % 6 == 5 WhenAUser.logger.warn "WhenAUser having trouble sending events; #{retries} attempts so far." end sleep [5, retries].max retry end WhenAUser.logger.warn "WhenAUser resuming service after #{retries} retries." unless retries == 0 end end |
Class Method Details
.push(*args) ⇒ Object
25 26 27 |
# File 'lib/whenauser/girl_friday_queue.rb', line 25 def self.push *args instance.push *args end |
.status ⇒ Object
29 30 31 |
# File 'lib/whenauser/girl_friday_queue.rb', line 29 def self.status instance.status end |