Class: Hatchet::StatusBasedIdempotencyConfig
- Inherits:
-
Object
- Object
- Hatchet::StatusBasedIdempotencyConfig
- Defined in:
- lib/hatchet/idempotency.rb,
sig/hatchet/idempotency.rbs
Overview
Status-based idempotency: keeps the idempotency key alive until the associated run
reaches a terminal status. fallback_ttl_ms caps how long the key can live before
it's evicted, even if the run has not reached a terminal status.
Instance Attribute Summary collapse
-
#expression ⇒ String
readonly
CEL expression evaluated against workflow input.
-
#fallback_ttl_ms ⇒ Integer
readonly
Fallback TTL in milliseconds; the longest the key can live.
Instance Method Summary collapse
-
#initialize(expression:, fallback_ttl_ms:) ⇒ StatusBasedIdempotencyConfig
constructor
A new instance of StatusBasedIdempotencyConfig.
- #to_proto ⇒ V1::IdempotencyConfig
Constructor Details
#initialize(expression:, fallback_ttl_ms:) ⇒ StatusBasedIdempotencyConfig
Returns a new instance of StatusBasedIdempotencyConfig.
47 48 49 50 |
# File 'lib/hatchet/idempotency.rb', line 47 def initialize(expression:, fallback_ttl_ms:) @expression = expression @fallback_ttl_ms = fallback_ttl_ms end |
Instance Attribute Details
#expression ⇒ String (readonly)
Returns CEL expression evaluated against workflow input.
40 41 42 |
# File 'lib/hatchet/idempotency.rb', line 40 def expression @expression end |
#fallback_ttl_ms ⇒ Integer (readonly)
Returns Fallback TTL in milliseconds; the longest the key can live.
43 44 45 |
# File 'lib/hatchet/idempotency.rb', line 43 def fallback_ttl_ms @fallback_ttl_ms end |
Instance Method Details
#to_proto ⇒ V1::IdempotencyConfig
53 54 55 56 57 58 59 |
# File 'lib/hatchet/idempotency.rb', line 53 def to_proto ::V1::IdempotencyConfig.new( expression: @expression, ttl_ms: @fallback_ttl_ms, method: ::V1::IdempotencyMethod::STATUS, ) end |