Class: Hatchet::WorkerRuntime::DurableEviction::DurableRunRecord
- Inherits:
-
Object
- Object
- Hatchet::WorkerRuntime::DurableEviction::DurableRunRecord
- Defined in:
- lib/hatchet/worker/durable_eviction/cache.rb
Overview
Per-run state tracked by the cache.
“wait_count“ is ref-counted so concurrent waits over the same durable run don’t prematurely clear the waiting flag when one child completes before the others.
Instance Attribute Summary collapse
-
#eviction_policy ⇒ Object
readonly
Returns the value of attribute eviction_policy.
-
#eviction_reason ⇒ Object
Returns the value of attribute eviction_reason.
-
#invocation_count ⇒ Object
readonly
Returns the value of attribute invocation_count.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#registered_at ⇒ Object
readonly
Returns the value of attribute registered_at.
-
#step_run_id ⇒ Object
readonly
Returns the value of attribute step_run_id.
-
#wait_count ⇒ Object
Returns the value of attribute wait_count.
-
#wait_kind ⇒ Object
Returns the value of attribute wait_kind.
-
#wait_resource_id ⇒ Object
Returns the value of attribute wait_resource_id.
-
#waiting_since ⇒ Object
Returns the value of attribute waiting_since.
Instance Method Summary collapse
-
#initialize(key:, step_run_id:, invocation_count:, eviction_policy:, registered_at:) ⇒ DurableRunRecord
constructor
A new instance of DurableRunRecord.
- #waiting? ⇒ Boolean
Constructor Details
#initialize(key:, step_run_id:, invocation_count:, eviction_policy:, registered_at:) ⇒ DurableRunRecord
Returns a new instance of DurableRunRecord.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 29 def initialize(key:, step_run_id:, invocation_count:, eviction_policy:, registered_at:) @key = key @step_run_id = step_run_id @invocation_count = invocation_count @eviction_policy = eviction_policy @registered_at = registered_at @waiting_since = nil @wait_kind = nil @wait_resource_id = nil @eviction_reason = nil @wait_count = 0 end |
Instance Attribute Details
#eviction_policy ⇒ Object (readonly)
Returns the value of attribute eviction_policy.
21 22 23 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 21 def eviction_policy @eviction_policy end |
#eviction_reason ⇒ Object
Returns the value of attribute eviction_reason.
22 23 24 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 22 def eviction_reason @eviction_reason end |
#invocation_count ⇒ Object (readonly)
Returns the value of attribute invocation_count.
21 22 23 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 21 def invocation_count @invocation_count end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
21 22 23 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 21 def key @key end |
#registered_at ⇒ Object (readonly)
Returns the value of attribute registered_at.
21 22 23 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 21 def registered_at @registered_at end |
#step_run_id ⇒ Object (readonly)
Returns the value of attribute step_run_id.
21 22 23 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 21 def step_run_id @step_run_id end |
#wait_count ⇒ Object
Returns the value of attribute wait_count.
22 23 24 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 22 def wait_count @wait_count end |
#wait_kind ⇒ Object
Returns the value of attribute wait_kind.
22 23 24 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 22 def wait_kind @wait_kind end |
#wait_resource_id ⇒ Object
Returns the value of attribute wait_resource_id.
22 23 24 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 22 def wait_resource_id @wait_resource_id end |
#waiting_since ⇒ Object
Returns the value of attribute waiting_since.
22 23 24 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 22 def waiting_since @waiting_since end |
Instance Method Details
#waiting? ⇒ Boolean
42 43 44 |
# File 'lib/hatchet/worker/durable_eviction/cache.rb', line 42 def waiting? @wait_count.positive? end |