Class: Sbmt::Outbox::V2::PollThrottler::PausedBox
- Inherits:
-
Base
- Object
- DryInteractor
- Base
- Sbmt::Outbox::V2::PollThrottler::PausedBox
- Defined in:
- lib/sbmt/outbox/v2/poll_throttler/paused_box.rb
Instance Method Summary collapse
-
#initialize(delay: 0.1) ⇒ PausedBox
constructor
A new instance of PausedBox.
- #wait(worker_num, poll_task, task_result) ⇒ Object
Methods inherited from Base
Methods inherited from DryInteractor
Constructor Details
#initialize(delay: 0.1) ⇒ PausedBox
Returns a new instance of PausedBox.
11 12 13 14 15 |
# File 'lib/sbmt/outbox/v2/poll_throttler/paused_box.rb', line 11 def initialize(delay: 0.1) super() @delay = delay end |
Instance Method Details
#wait(worker_num, poll_task, task_result) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/sbmt/outbox/v2/poll_throttler/paused_box.rb', line 17 def wait(worker_num, poll_task, task_result) return Success(Sbmt::Outbox::V2::Throttler::NOOP_STATUS) if poll_task.item_class.config.polling_enabled? sleep(@delay) Success(Sbmt::Outbox::V2::Throttler::SKIP_STATUS) end |