Skip to main content

ReclaimGrant

Struct ReclaimGrant 

Source
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_interruptedstarted 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:

  • ClaimGrant is issued against a freshly-eligible execution and ff_claim_execution creates a new attempt.
  • ReclaimGrant is issued against an attempt_interrupted execution; ff_claim_resumed_execution re-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: ExecutionId

The execution granted for resumption.

§partition_key: PartitionKey

Opaque 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: String

Valkey key of the grant hash — same key shape as ClaimGrant.

§expires_at_ms: u64

Monotonic ms when the grant expires; unconsumed grants vanish.

§lane_id: LaneId

Lane the execution belongs to. Needed by ff_claim_resumed_execution for KEYS[3] (eligible_zset) and KEYS[9] (active_index).

Implementations§

Source§

impl ReclaimGrant

Source

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

Source§

fn clone(&self) -> ReclaimGrant

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReclaimGrant

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ReclaimGrant

Source§

fn eq(&self, other: &ReclaimGrant) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ReclaimGrant

Source§

impl StructuralPartialEq for ReclaimGrant

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.