\ActionScheduler_AsyncRequest_QueueRunner

ActionScheduler_AsyncRequest_QueueRunner class.

Summary

Methods
Properties
Constants
__construct()
data()
dispatch()
maybe_handle()
maybe_dispatch()
No public properties found
No constants found
get_query_args()
get_query_url()
get_post_args()
handle()
allow()
get_sleep_seconds()
$prefix
$action
$identifier
$data
$store
N/A
No private methods found
No private properties found
N/A

Properties

$prefix

$prefix : string

Prefix for ajax hooks

(default value: 'wp')

Type

normal

$action

$action : string

Action for ajax hooks

(default value: 'async_request')

Type

normal

$identifier

$identifier : mixed

Identifier

Type

normal

$data

$data : array

Data

(default value: array())

Type

normal

$store

$store : \ActionScheduler_Store

Data store for querying actions

Type

normal

Methods

__construct()

__construct(\ActionScheduler_Store  $store) : mixed

Initiate new async request.

Parameters

\ActionScheduler_Store $store

Store object.

Returns

mixed

data()

data(array  $data) : $this

Set data used during the request

Parameters

array $data

Data.

Returns

$this

dispatch()

dispatch() : array|\WP_Error

Dispatch the async request

Returns

array|\WP_Error

maybe_handle()

maybe_handle() : mixed

Maybe handle

Check for correct nonce and pass to handler.

Returns

mixed

maybe_dispatch()

maybe_dispatch() : mixed

If the async request runner is needed and allowed to run, dispatch a request.

Returns

mixed

get_query_args()

get_query_args() : array

Get query args

Returns

array

get_query_url()

get_query_url() : string

Get query URL

Returns

string

get_post_args()

get_post_args() : array

Get post args

Returns

array

handle()

handle() : mixed

Handle async requests

Run a queue, and maybe dispatch another async request to run another queue if there are still pending actions after completing a queue in this request.

Returns

mixed

allow()

allow() : mixed

Only allow async requests when needed.

Also allow 3rd party code to disable running actions via async requests.

Returns

mixed

get_sleep_seconds()

get_sleep_seconds() : mixed

Chaining async requests can crash MySQL. A brief sleep call in PHP prevents that.

Returns

mixed