@squidcloud/client
    Preparing search index...

    Class JobClient

    Handles job subscriptions and notifications.

    Important: Each jobId must be globally unique and kept private. Anyone who knows a job’s ID can query its status or result.

    Index

    Methods

    • Waits until the specified job finishes, then resolves with its result or throws if the job fails.

      Type Parameters

      • T = any

      Parameters

      • jobId: string

        A unique, private identifier for the job. Do not reuse a jobId across clients—possessing the ID allows anyone to inspect the job’s state.

      Returns Promise<T>

    • Resolves a job this client owns successfully with its result.

      Type Parameters

      • T = unknown

      Parameters

      • jobId: string
      • result: T

      Returns Promise<void>

    • Resolves a job this client owns as failed with an error message.

      Parameters

      • jobId: string
      • error: string

      Returns Promise<void>

    • Retrieves the current status (and, if completed, the result) of a job.

      Type Parameters

      • T = any

      Parameters

      • jobId: string

        A unique, private identifier for the job. Do not reuse a jobId across clients—possessing the ID allows anyone to inspect the job’s state.

      Returns Promise<AsyncJob<T> | undefined>

    • Starts a long-running job under a caller-generated jobId. The client owns the job until it resolves it via completeJob or failJob; while owned, the job is kept alive so core does not fail it. The jobId must be globally unique and kept private.

      Parameters

      • jobId: string

      Returns Promise<void>