Exception: TIMEx::Expired
- Inherits:
-
Exception
- Object
- Exception
- TIMEx::Expired
- Defined in:
- lib/timex/expired.rb
Overview
Inherits from Exception (not StandardError), so rescue without a
type and most rescue StandardError handlers will not catch this.
Rescue TIMEx::Expired explicitly when you wrap raw strategy code. For
+StandardError+-compatible behavior use on_timeout: :raise_standard,
which raises TimeoutError with this exception as #cause.
Raised when a deadline elapses while a strategy is executing user work.
Strategies catch Expired, record telemetry, then dispatch through
TimeoutHandling according to on_timeout:.
Instance Attribute Summary collapse
-
#deadline_ms ⇒ Object
readonly
Returns the value of attribute deadline_ms.
-
#elapsed_ms ⇒ Object
readonly
Returns the value of attribute elapsed_ms.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(message = "deadline expired", strategy: nil, deadline_ms: nil, elapsed_ms: nil) ⇒ Expired
constructor
A new instance of Expired.
Constructor Details
#initialize(message = "deadline expired", strategy: nil, deadline_ms: nil, elapsed_ms: nil) ⇒ Expired
Returns a new instance of Expired.
26 27 28 29 30 31 |
# File 'lib/timex/expired.rb', line 26 def initialize( = "deadline expired", strategy: nil, deadline_ms: nil, elapsed_ms: nil) super() @strategy = strategy @deadline_ms = deadline_ms @elapsed_ms = elapsed_ms end |
Instance Attribute Details
#deadline_ms ⇒ Object (readonly)
Returns the value of attribute deadline_ms.
20 21 22 |
# File 'lib/timex/expired.rb', line 20 def deadline_ms @deadline_ms end |
#elapsed_ms ⇒ Object (readonly)
Returns the value of attribute elapsed_ms.
20 21 22 |
# File 'lib/timex/expired.rb', line 20 def elapsed_ms @elapsed_ms end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
20 21 22 |
# File 'lib/timex/expired.rb', line 20 def strategy @strategy end |