#[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,
) -> ResumeGrant
pub fn new( execution_id: ExecutionId, partition_key: PartitionKey, grant_key: String, expires_at_ms: u64, lane_id: LaneId, ) -> ResumeGrant
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 moreSource§impl Debug for ResumeGrant
impl Debug for ResumeGrant
Source§impl PartialEq for ResumeGrant
impl PartialEq for ResumeGrant
impl Eq for ResumeGrant
impl StructuralPartialEq for ResumeGrant
Auto Trait Implementations§
impl Freeze for ResumeGrant
impl RefUnwindSafe for ResumeGrant
impl Send for ResumeGrant
impl Sync for ResumeGrant
impl Unpin for ResumeGrant
impl UnsafeUnpin for ResumeGrant
impl UnwindSafe for ResumeGrant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more