Class: Hatchet::TTLBasedIdempotencyConfig
- Inherits:
-
Object
- Object
- Hatchet::TTLBasedIdempotencyConfig
- Defined in:
- lib/hatchet/idempotency.rb,
sig/hatchet/idempotency.rbs
Overview
TTL-based idempotency: prevents duplicate runs within a sliding time window.
Instance Attribute Summary collapse
-
#expression ⇒ String
readonly
CEL expression evaluated against workflow input.
-
#ttl_ms ⇒ Integer
readonly
How long the idempotency key lives, in milliseconds.
Instance Method Summary collapse
-
#initialize(expression:, ttl_ms:) ⇒ TTLBasedIdempotencyConfig
constructor
A new instance of TTLBasedIdempotencyConfig.
- #to_proto ⇒ V1::IdempotencyConfig
Constructor Details
#initialize(expression:, ttl_ms:) ⇒ TTLBasedIdempotencyConfig
Returns a new instance of TTLBasedIdempotencyConfig.
17 18 19 20 |
# File 'lib/hatchet/idempotency.rb', line 17 def initialize(expression:, ttl_ms:) @expression = expression @ttl_ms = ttl_ms end |
Instance Attribute Details
#expression ⇒ String (readonly)
Returns CEL expression evaluated against workflow input.
10 11 12 |
# File 'lib/hatchet/idempotency.rb', line 10 def expression @expression end |
#ttl_ms ⇒ Integer (readonly)
Returns How long the idempotency key lives, in milliseconds.
13 14 15 |
# File 'lib/hatchet/idempotency.rb', line 13 def ttl_ms @ttl_ms end |
Instance Method Details
#to_proto ⇒ V1::IdempotencyConfig
23 24 25 |
# File 'lib/hatchet/idempotency.rb', line 23 def to_proto ::V1::IdempotencyConfig.new(expression: @expression, ttl_ms: @ttl_ms) end |