pub struct ReclaimGrant {
pub execution_id: ExecutionId,
pub partition_key: PartitionKey,
pub grant_key: String,
pub expires_at_ms: u64,
pub lane_id: LaneId,
}Expand description
A reclaim grant issued for a resumed (attempt_interrupted) execution.
Issued by a producer (typically ff-scheduler once a Batch-C
reclaim scanner is in place; test fixtures in the interim — no
production Rust caller exists in-tree today). Consumed by
FlowFabricWorker::claim_from_reclaim_grant, which calls
ff_claim_resumed_execution atomically: that FCALL validates the
grant, consumes it, and transitions attempt_interrupted →
started while preserving the existing attempt_index +
attempt_id (a resumed execution re-uses its attempt; it does
not start a new one).
Mirrors ClaimGrant for the resume path. Differences:
ClaimGrantis issued against a freshly-eligible execution andff_claim_executioncreates a new attempt.ReclaimGrantis issued against anattempt_interruptedexecution;ff_claim_resumed_executionre-uses the existing attempt and bumps the lease epoch.
The grant itself is written to the same claim_grant Valkey key
that ClaimGrant uses; the distinction is which Lua FCALL
consumes it (ff_claim_execution for new attempts,
ff_claim_resumed_execution for resumes).
Lane asymmetry with ClaimGrant: ReclaimGrant CARRIES
lane_id as a field. The issuing path already knows the lane
(it’s read from exec_core at grant time); carrying it here
spares the consumer a HGET exec_core lane_id round trip on
the hot claim path. The asymmetry is intentional — prefer
one-fewer-HGET on a type that already lives with the resumer’s
lifecycle over strict handle symmetry with ClaimGrant.
Shared wire-level type between the eventual ff-scheduler
producer (Batch-C reclaim scanner — not yet in-tree; test
fixtures construct this type today) and ff-sdk (consumer, via
FlowFabricWorker::claim_from_reclaim_grant). Lives in
ff-core so neither crate needs a dep on the other.
Fields§
§execution_id: ExecutionIdThe execution granted for resumption.
partition_key: PartitionKeyOpaque partition handle for this execution’s hash-tag slot.
Same wire-opacity contract as ClaimGrant::partition_key.
Internal consumers call Self::partition for the parsed
form.
grant_key: StringValkey key of the grant hash — same key shape as
ClaimGrant.
expires_at_ms: u64Monotonic ms when the grant expires; unconsumed grants vanish.
lane_id: LaneIdLane the execution belongs to. Needed by
ff_claim_resumed_execution for KEYS[3] (eligible_zset)
and KEYS[9] (active_index).
Implementations§
Source§impl ReclaimGrant
impl ReclaimGrant
Sourcepub fn partition(&self) -> Result<Partition, PartitionKeyParseError>
pub fn partition(&self) -> Result<Partition, PartitionKeyParseError>
Parse partition_key into a typed
crate::partition::Partition. See ClaimGrant::partition
for the alias-collapse note.
Trait Implementations§
Source§impl Clone for ReclaimGrant
impl Clone for ReclaimGrant
Source§fn clone(&self) -> ReclaimGrant
fn clone(&self) -> ReclaimGrant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more