FlowFabric Worker SDK — public API for worker authors.
This crate depends on ff-script for the Lua-function types, Lua error
kinds (ScriptError), and retry helpers (is_retryable_kind,
kind_to_stable_str). Consumers using ff-sdk do not need to import
ff-script directly for normal worker operations, but can if they need
the ScriptError or retry types.
Quick start
The production claim path is
[FlowFabricWorker::claim_from_grant]: obtain a
ClaimGrant from ff_scheduler::Scheduler::claim_for_worker
(the scheduler enforces budget, quota, and capability checks),
then hand it to the SDK. claim_next is gated behind the
default-off direct-valkey-claim feature and bypasses admission
control — fine for benchmarks, not production.
use ;
use BackendConfig;
use ;
async
Migration: direct-valkey-claim → scheduler-issued grants
The direct-valkey-claim cargo feature — which gates
[FlowFabricWorker::claim_next] — is deprecated in favour of
the pair of scheduler-issued grant entry points:
- [
FlowFabricWorker::claim_from_grant] — fresh claims. Useff_scheduler::Scheduler::claim_for_workerto obtain theClaimGrant, then hand it to the SDK. - [
FlowFabricWorker::claim_from_reclaim_grant] — resumed claims for anattempt_interruptedexecution. Wraps aReclaimGrant.
claim_next bypasses budget and quota admission control; the
grant-based path does not. See each method's rustdoc for the
exact migration recipe.