Class: Rage::Deferred::Metadata
- Inherits:
-
Object
- Object
- Rage::Deferred::Metadata
- Defined in:
- lib/rage/deferred/metadata.rb
Overview
Provides metadata about the current deferred task execution.
Class Method Summary collapse
-
.attempts ⇒ Integer
Returns the current attempt number.
-
.retries ⇒ Integer
Returns the number of retries that have occurred for the current task.
-
.retrying? ⇒ Boolean
Checks whether this is a retry execution.
-
.will_retry? ⇒ Boolean
Checks whether the task will be retried if the current execution fails.
Class Method Details
.attempts ⇒ Integer
Returns the current attempt number.
10 11 12 |
# File 'lib/rage/deferred/metadata.rb', line 10 def attempts Rage::Deferred::Context.get_attempts(context).to_i + 1 end |
.retries ⇒ Integer
Returns the number of retries that have occurred for the current task.
16 17 18 |
# File 'lib/rage/deferred/metadata.rb', line 16 def retries attempts - 1 end |
.retrying? ⇒ Boolean
Checks whether this is a retry execution.
22 23 24 |
# File 'lib/rage/deferred/metadata.rb', line 22 def attempts > 1 end |