Documentation

ActionScheduler_Abstract_QueueRunner extends ActionScheduler_Abstract_QueueRunner_Deprecated
in package

Abstract class with common Queue Cleaner functionality.

Table of Contents

$cleaner  : ActionScheduler_QueueCleaner
$monitor  : ActionScheduler_FatalErrorMonitor
$store  : ActionScheduler_Store
$created_time  : int
The created time.
__construct()  : mixed
ActionScheduler_Abstract_QueueRunner constructor.
get_allowed_concurrent_batches()  : int
Get the number of concurrent batches a runner allows.
process_action()  : mixed
Process an individual action.
run()  : int
Process actions in the queue.
batch_limits_exceeded()  : bool
See if the batch limits have been exceeded, which is when memory usage is almost at the maximum limit, or the time to process more actions will exceed the max time limit.
get_execution_time()  : int
Get the number of seconds the process has been running.
get_maximum_execution_time()  : int
Get the maximum number of seconds a batch can run for.
get_memory_limit()  : int
Get memory limit
get_time_limit()  : int
Get the maximum number of seconds a batch can run for.
memory_exceeded()  : bool
Memory exceeded
run_cleanup()  : mixed
Run the queue cleaner.
schedule_next_instance()  : mixed
Schedule the next instance of the action if necessary.
time_likely_to_be_exceeded()  : bool
Check if the host's max execution time is (likely) to be exceeded if processing more actions.

Properties

$created_time

The created time.

private int $created_time

Represents when the queue runner was constructed and used when calculating how long a PHP request has been running. For this reason it should be as close as possible to the PHP request start time.

Methods

get_allowed_concurrent_batches()

Get the number of concurrent batches a runner allows.

public get_allowed_concurrent_batches() : int
Return values
int

process_action()

Process an individual action.

public process_action(int $action_id) : mixed
Parameters
$action_id : int

The action ID to process.

Return values
mixed

batch_limits_exceeded()

See if the batch limits have been exceeded, which is when memory usage is almost at the maximum limit, or the time to process more actions will exceed the max time limit.

protected batch_limits_exceeded(int $processed_actions) : bool

Based on WC_Background_Process::batch_limits_exceeded()

Parameters
$processed_actions : int

The number of actions processed so far - used to determine the likelihood of exceeding the time limit if processing another action

Return values
bool

get_execution_time()

Get the number of seconds the process has been running.

protected get_execution_time() : int
Return values
int

The number of seconds.

memory_exceeded()

Memory exceeded

protected memory_exceeded() : bool

Ensures the batch process never exceeds 90% of the maximum WordPress memory.

Based on WP_Background_Process::memory_exceeded()

Return values
bool

time_likely_to_be_exceeded()

Check if the host's max execution time is (likely) to be exceeded if processing more actions.

protected time_likely_to_be_exceeded(int $processed_actions) : bool
Parameters
$processed_actions : int

The number of actions processed so far - used to determine the likelihood of exceeding the time limit if processing another action

Return values
bool

Search results