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 moreSource§impl Debug for ReclaimGrant
impl Debug for ReclaimGrant
Source§impl PartialEq for ReclaimGrant
impl PartialEq for ReclaimGrant
impl Eq for ReclaimGrant
impl StructuralPartialEq for ReclaimGrant
Auto Trait Implementations§
impl Freeze for ReclaimGrant
impl RefUnwindSafe for ReclaimGrant
impl Send for ReclaimGrant
impl Sync for ReclaimGrant
impl Unpin for ReclaimGrant
impl UnsafeUnpin for ReclaimGrant
impl UnwindSafe for ReclaimGrant
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