prorm API Reference
    Preparing search index...

    Class GearmanStore

    GearmanStore wraps a single gearman client and exposes the common queue surface over Gearman functions: enqueue() submits a job, process() registers a worker handler, and job status/removal/stats route to the driver's corresponding calls.

    Implements

    Index
    name: "gearman" = 'gearman'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "gearman" = 'gearman'

    The client library being used

    • Submit a job for the named function (queue). The payload is JSON-serialized (strings pass through). Returns the job handle/id the server assigns (job.handle if the driver returns a job object).

      Parameters

      • queue: string
      • jobData: unknown
      • opts: GearmanSubmitOptions = {}

      Returns Promise<string>

    • Register a worker handler for the named function (queue). The driver invokes handler(job) for each dispatched task. Falls back to addFunction() when the driver has no registerWorker().

      Parameters

      • queue: string
      • handler: (job: any) => void | Promise<void>

      Returns Promise<void>

    • Query the status of a submitted job by its handle/id.

      Parameters

      • _queue: string
      • id: string

      Returns Promise<any>

    • Cancel/forget a submitted job by its handle/id.

      Parameters

      • _queue: string
      • id: string

      Returns Promise<any>

    • Return job-server status (registered functions, queued/running counts).

      Parameters

      • Optional_queue: string

      Returns Promise<any>