Sporades SDK API
    Preparing search index...

    Type Alias JobApi

    Server-only runtime-owned Job Queue API.

    Current-user access is scoped to the captured execution actor. Privileged access may inspect all Jobs when used explicitly through ctx.privileged.

    type JobApi = {
        cancel(id: string): Promise<JobState | null>;
        enqueue(
            handler: string,
            payload: JsonValue,
            options?: {
                availableAt?: string | Date;
                idempotencyKey?: string;
                retry?: { delayMs?: number; maxAttempts: number };
            },
        ): Promise<JobState>;
        get(id: string): Promise<JobState | null>;
        list(
            options?: { cursor?: string; limit?: number },
        ): Promise<{ jobs: JobSummary[]; nextCursor: string | null }>;
    }
    Index
    • Parameters

      • handler: string
      • payload: JsonValue
      • Optionaloptions: {
            availableAt?: string | Date;
            idempotencyKey?: string;
            retry?: { delayMs?: number; maxAttempts: number };
        }

      Returns Promise<JobState>

    • Parameters

      • Optionaloptions: { cursor?: string; limit?: number }

      Returns Promise<{ jobs: JobSummary[]; nextCursor: string | null }>