Exception: RubyReactor::OrderedLock::WaitError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ruby_reactor/ordered_lock.rb

Overview

Raised by the gate check when the worker’s nonce is ahead of ‘last_completed + 1`. Carries `retry_after_seconds`, a hint derived from the poison-pill timeout on the blocker nonce.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, nonce:, last_completed:, retry_after_seconds:) ⇒ WaitError

Returns a new instance of WaitError.



17
18
19
20
21
22
23
# File 'lib/ruby_reactor/ordered_lock.rb', line 17

def initialize(key:, nonce:, last_completed:, retry_after_seconds:)
  @key = key
  @nonce = nonce
  @last_completed = last_completed
  @retry_after_seconds = retry_after_seconds
  super("OrderedLock '#{key}' nonce #{nonce} waiting on #{last_completed + 1}")
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



15
16
17
# File 'lib/ruby_reactor/ordered_lock.rb', line 15

def key
  @key
end

#last_completedObject (readonly)

Returns the value of attribute last_completed.



15
16
17
# File 'lib/ruby_reactor/ordered_lock.rb', line 15

def last_completed
  @last_completed
end

#nonceObject (readonly)

Returns the value of attribute nonce.



15
16
17
# File 'lib/ruby_reactor/ordered_lock.rb', line 15

def nonce
  @nonce
end

#retry_after_secondsObject (readonly)

Returns the value of attribute retry_after_seconds.



15
16
17
# File 'lib/ruby_reactor/ordered_lock.rb', line 15

def retry_after_seconds
  @retry_after_seconds
end