Beignet API reference
    Preparing search index...

    Interface JobExecutionLeaseHookOptions<J, Ctx>

    Options for createJobExecutionLeaseHook(...).

    interface JobExecutionLeaseHookOptions<J extends JobDef = JobDef, Ctx = unknown> {
        key:
            | string
            | ((args: JobExecutionLeaseResolverArgs<J, Ctx>) => MaybePromise<string>);
        keyPrefix?: string;
        locks: JobExecutionLeaseLocksResolver<J, Ctx>;
        metadata?: JobExecutionLeaseMetadataResolver<J, Ctx>;
        onUnavailable?: JobExecutionLeaseUnavailableBehavior<J, Ctx>;
        retryDelay?: JobDuration;
        ttl: JobDuration;
        wait?: JobDuration;
    }

    Type Parameters

    Index
    key:
        | string
        | ((args: JobExecutionLeaseResolverArgs<J, Ctx>) => MaybePromise<string>)

    Logical lease key within this job name.

    keyPrefix?: string

    Prefix used to build the concrete lock key.

    Defaults to "jobs:lease".

    Locks port or resolver used to acquire the execution lease.

    Optional diagnostics metadata attached to the lease acquire call.

    Behavior when the lease cannot be acquired.

    Defaults to "skip" so overlapping executions do not create retry storms.

    retryDelay?: JobDuration

    Delay between acquisition attempts while waiting.

    Lease time-to-live. This is the real safety boundary in serverless runtimes where an invocation may terminate before finally runs.

    How long to wait for an existing lease before applying onUnavailable.

    Defaults to no wait.