Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-packages/real-queue/lib/types/events/clientJob"

Index

Type aliases

Variables

Type aliases

ClientJobEvent

ClientJobEvent<JobData>: { fetchJob: typeof fetchJob; job: Job<JobData>; reject: (reason?: Parameters<typeof saveJobResult>[2]) => void; resolve: (value: void | PromiseLike<void>) => void; run: number; saveJobResult: typeof saveJobResult }

Type parameters

  • JobData = any

Type declaration

  • fetchJob: typeof fetchJob
  • job: Job<JobData>
  • reject: (reason?: Parameters<typeof saveJobResult>[2]) => void
      • (reason?: Parameters<typeof saveJobResult>[2]): void
      • Parameters

        • Optional reason: Parameters<typeof saveJobResult>[2]

        Returns void

  • resolve: (value: void | PromiseLike<void>) => void
      • (value: void | PromiseLike<void>): void
      • Parameters

        • value: void | PromiseLike<void>

        Returns void

  • run: number

    The number of runs retried for this job, e.g. your code has thrown an exception

  • saveJobResult: typeof saveJobResult

Variables

Const CLIENT_JOB_EVENT_PREFIX

CLIENT_JOB_EVENT_PREFIX: "RealQueue/ClientJob/" = "RealQueue/ClientJob/"

You need to append the type to the event name, e.g. RealQueue/ClientJob/example.

This should execute the client job via JavaScript. Keep in mind, that you need to manually update the process via a server request for each item! See also the PHP class DevOwl\RealQueue\queue\Job#worker for more information.

You are allowed to throw errors, this causes the client job to be retried according to retries.

Generated using TypeDoc