#[non_exhaustive]pub struct ResumeGrant {
pub execution_id: ExecutionId,
pub partition_key: PartitionKey,
pub grant_key: String,
pub expires_at_ms: u64,
pub lane_id: LaneId,
}Expand description
A resume 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_resume_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).
Naming history (RFC-024). This type was historically called
ReclaimGrant, but its semantic has always been resume-after-
suspend (the routing FCALL is ff_claim_resumed_execution, not
ff_reclaim_execution). RFC-024 PR-A renamed the type to
ResumeGrant — the name now matches the semantic. RFC-024 PR-B+C
dropped the transitional ReclaimGrant = ResumeGrant alias and
introduced a distinct new ReclaimGrant for the lease-reclaim
path (reclaim_execution / ff_reclaim_execution).
Mirrors ClaimGrant for the resume path. Differences:
ClaimGrantis issued against a freshly-eligible execution andff_claim_executioncreates a new attempt.ResumeGrantis 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: ResumeGrant 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_resume_grant). Lives in
ff-core so neither crate needs a dep on the other.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.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 ResumeGrant
impl ResumeGrant
Sourcepub fn new(
execution_id: ExecutionId,
partition_key: PartitionKey,
grant_key: String,
expires_at_ms: u64,
lane_id: LaneId,
) -> Self
pub fn new( execution_id: ExecutionId, partition_key: PartitionKey, grant_key: String, expires_at_ms: u64, lane_id: LaneId, ) -> Self
Construct a resume grant. Added alongside #[non_exhaustive]
per RFC-024 §3.1 + feedback_non_exhaustive_needs_constructor.
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 ResumeGrant
impl Clone for ResumeGrant
Source§fn clone(&self) -> ResumeGrant
fn clone(&self) -> ResumeGrant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more