Menu

## ActionScheduler_Abstract_QueueRunner extends ActionScheduler_Abstract_QueueRunner_Deprecated
in package

ActionScheduler_Abstract_QueueRunner.php : 6

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

#### $cleaner

ActionScheduler_Abstract_QueueRunner.php : 9
`protected ActionScheduler_QueueCleaner $cleaner`

#### $monitor

ActionScheduler_Abstract_QueueRunner.php : 12
`protected ActionScheduler_FatalErrorMonitor $monitor`

#### $store

ActionScheduler_Abstract_QueueRunner.php : 15
`protected ActionScheduler_Store $store`

#### $created_time

ActionScheduler_Abstract_QueueRunner.php : 25

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

#### __construct()

ActionScheduler_Abstract_QueueRunner.php : 34

ActionScheduler_Abstract_QueueRunner constructor.

`public __construct([ActionScheduler_Store $store = null ][, ActionScheduler_FatalErrorMonitor $monitor = null ][, ActionScheduler_QueueCleaner $cleaner = null ]) : mixed`

##### Parameters

$store : ActionScheduler_Store = null
$monitor : ActionScheduler_FatalErrorMonitor = null
$cleaner : ActionScheduler_QueueCleaner = null

##### Return values

mixed —

#### get_allowed_concurrent_batches()

ActionScheduler_Abstract_QueueRunner.php : 100

Get the number of concurrent batches a runner allows.

`public get_allowed_concurrent_batches() : int`

##### Return values

int —

#### process_action()

ActionScheduler_Abstract_QueueRunner.php : 48

Process an individual action.

`public process_action(int $action_id) : mixed`

##### Parameters

$action_id : int

  The action ID to process.

##### Return values

mixed —

#### run()

ActionScheduler_Abstract_QueueRunner.php : 218

Process actions in the queue.

`public abstract run() : int`

##### Tags

author

  Jeremy Pry

##### Return values

int —

The number of actions processed.

#### batch_limits_exceeded()

ActionScheduler_Abstract_QueueRunner.php : 208

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()

ActionScheduler_Abstract_QueueRunner.php : 127

Get the number of seconds the process has been running.

`protected get_execution_time() : int`

##### Return values

int —

The number of seconds.

#### get_maximum_execution_time()

ActionScheduler_Abstract_QueueRunner_Deprecated.php : 14

Get the maximum number of seconds a batch can run for.

`protected get_maximum_execution_time() : int`

##### Tags

deprecated
  2.1.1

##### Return values

int —

The number of seconds.

#### get_memory_limit()

ActionScheduler_Abstract_QueueRunner.php : 166

Get memory limit

`protected get_memory_limit() : int`

Based on WP_Background_Process::get_memory_limit()

##### Return values

int —

#### get_time_limit()

ActionScheduler_Abstract_QueueRunner.php : 109

Get the maximum number of seconds a batch can run for.

`protected get_time_limit() : int`

##### Return values

int —

The number of seconds.

#### memory_exceeded()

ActionScheduler_Abstract_QueueRunner.php : 190

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 —

#### run_cleanup()

ActionScheduler_Abstract_QueueRunner.php : 91

Run the queue cleaner.

`protected run_cleanup() : mixed`

##### Tags

author

  Jeremy Pry

##### Return values

mixed —

#### schedule_next_instance()

ActionScheduler_Abstract_QueueRunner.php : 77

Schedule the next instance of the action if necessary.

`protected schedule_next_instance(ActionScheduler_Action $action) : mixed`

##### Parameters

$action : ActionScheduler_Action

##### Return values

mixed —

#### time_likely_to_be_exceeded()

ActionScheduler_Abstract_QueueRunner.php : 148

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