Exception: Wurk::Limiter::OverLimit
- Inherits:
-
StandardError
- Object
- StandardError
- Wurk::Limiter::OverLimit
- Defined in:
- lib/wurk/limiter.rb
Overview
Server middleware catches OverLimit, increments ‘job`, and reschedules onto the same queue with `Time.now + backoff`. The `#limiter` attr lets the middleware reach the per-limiter backoff proc + reschedule cap. `#job` is set by the middleware just before the re-raise so error_handlers can see which job was in flight.
Instance Attribute Summary collapse
-
#job ⇒ Object
Returns the value of attribute job.
-
#limiter ⇒ Object
readonly
Returns the value of attribute limiter.
Instance Method Summary collapse
-
#initialize(limiter, job = nil, msg = nil) ⇒ OverLimit
constructor
A new instance of OverLimit.
Constructor Details
#initialize(limiter, job = nil, msg = nil) ⇒ OverLimit
Returns a new instance of OverLimit.
51 52 53 54 55 |
# File 'lib/wurk/limiter.rb', line 51 def initialize(limiter, job = nil, msg = nil) @limiter = limiter @job = job super(msg || "limit '#{limiter.name}' (#{limiter.type}) reached") end |
Instance Attribute Details
#job ⇒ Object
Returns the value of attribute job.
49 50 51 |
# File 'lib/wurk/limiter.rb', line 49 def job @job end |
#limiter ⇒ Object (readonly)
Returns the value of attribute limiter.
48 49 50 |
# File 'lib/wurk/limiter.rb', line 48 def limiter @limiter end |