Documentation

Queue
in package
Uses UtilsProvider

Create queue REST service.

Table of Contents

Constants

LOCK_UNTIL_SECONDS  = self::MAX_EXECUTION_SECONDS_PER_REQUEST * self::MAX_BATCH_CLIENT_SIZE
MAX_BATCH_CLIENT_SIZE  = 25
MAX_EXECUTION_SECONDS_PER_REQUEST  = 5

Properties

$core  : mixed

Methods

__construct()  : mixed
C'tor.
buildStatus()  : mixed
Create the response array for the `/status` route.
getPluginConstantPrefix()  : string
Get the prefix of this package so we can utils package natively.
rest_api_init()  : mixed
Register endpoints.
routeJobExecute()  : mixed
See API docs.
routeJobGet()  : mixed
See API docs.
routeJobResult()  : mixed
See API docs.
routeJobsDelete()  : mixed
See API docs.
routeJobsGet()  : mixed
See API docs.
routeJobsRetry()  : mixed
See API docs.
routeJobsSkip()  : mixed
See API docs.
routeStatus()  : mixed
See API docs.
setupConstants()  : mixed
Make sure the REAL_QUEUE constants are available.
fetchAdditionalData()  : mixed
Extend the REST API response with requested additional data.

Constants

LOCK_UNTIL_SECONDS

public mixed LOCK_UNTIL_SECONDS = self::MAX_EXECUTION_SECONDS_PER_REQUEST * self::MAX_BATCH_CLIENT_SIZE

MAX_BATCH_CLIENT_SIZE

public mixed MAX_BATCH_CLIENT_SIZE = 25

MAX_EXECUTION_SECONDS_PER_REQUEST

public mixed MAX_EXECUTION_SECONDS_PER_REQUEST = 5

Properties

Methods

__construct()

C'tor.

public __construct(Core $core) : mixed
Parameters
$core : Core
Tags
codeCoverageIgnore

buildStatus()

Create the response array for the `/status` route.

public buildStatus(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

getPluginConstantPrefix()

Get the prefix of this package so we can utils package natively.

public getPluginConstantPrefix() : string
Return values
string

rest_api_init()

Register endpoints.

public rest_api_init() : mixed

routeJobExecute()

See API docs.

public routeJobExecute(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{string} [tryIds] Comma separated list of additional job ids which could be tried to be executed, too

apiName

ExecuteJob

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeJobGet()

See API docs.

public routeJobGet(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{boolean} lock Set to true or false so other tabs could not pick this job

apiName

GetJob

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeJobResult()

See API docs.

public routeJobResult(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{number} process

apiParam

{string} [errorCode]

apiParam

{string} [errorMessage]

apiParam

{string} [errorData] JSON string (WP 5.0 does not yet support JSON schema as parameters)

apiName

ResultJob

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeJobsDelete()

See API docs.

public routeJobsDelete(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{string} [type] Delete all jobs by type

apiName

DeleteJobs

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeJobsGet()

See API docs.

public routeJobsGet(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{number} after Read only jobs after this job ID

apiParam

{string} ids Read only this Job IDs (comma-separated string)

apiParam

{string} [additionalData]

apiName

GetJobs

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeJobsRetry()

See API docs.

public routeJobsRetry(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{string} [type] Retry all jobs by type

apiName

RetryJobs

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeJobsSkip()

See API docs.

public routeJobsSkip(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiParam

{string} [type] Skip all failed jobs by type

apiName

RetryJobs

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

routeStatus()

See API docs.

public routeStatus(WP_REST_Request $request) : mixed
APIYes
Parameters
$request : WP_REST_Request
Tags
apiHeader

{string} X-WP-Nonce

apiName

Status

apiPermission

edit_posts

apiGroup

Queue

apiVersion

1.0.0

setupConstants()

Make sure the REAL_QUEUE constants are available.

public static setupConstants() : mixed

fetchAdditionalData()

Extend the REST API response with requested additional data.

protected fetchAdditionalData(array<string|int, string> $additionalData) : mixed
Parameters
$additionalData : array<string|int, string>

        
On this page

Search results