Sanity Library Reference Docs
    Preparing search index...

    Interface EngineEffectsArgs<Client>

    Everything this engine needs to run pending effects, in one group. Engine.drainEffects dispatches through handlers under a leaseMs claim, and both the drain and Engine.verifyDeployedDefinitions apply missingHandler to an effect name no handler covers.

    interface EngineEffectsArgs<Client extends WorkflowClient = WorkflowClient> {
        handlers?: Record<string, EffectHandler<Client>>;
        leaseMs?: number;
        missingHandler?: MissingHandlerPolicy;
    }

    Type Parameters

    Index

    Properties

    handlers?: Record<string, EffectHandler<Client>>

    Effect handlers keyed by the effect name the definition queues.

    leaseMs?: number

    Lease duration drainEffects stamps on each pending-effect claim. Past the lease the claimer is presumed dead: the entry becomes recoverable by another drain's takeover or by the standalone sweepStaleClaims export. Default 5 minutes — size it well above the slowest handler's honest runtime, since a live-but-slow dispatch that outlives its lease can be redispatched (see EffectHandler).

    missingHandler?: MissingHandlerPolicy

    What to do with an effect name handlers doesn't cover. Default fail.