BackgroundPausableProcess
extends BackgroundProcess
in package
Tags
Table of Contents
- $completedTasksOption : mixed
- $paused : bool
- $prefix : mixed
- $tasksCountOption : mixed
- $waitActionsOption : string
- __construct() : mixed
- getCompletedTasksCount() : int
- getIdentifier() : string
- getProgress() : float
- getQueueSize() : int
- getTasksCount() : int
- handle_cron_healthcheck() : mixed
- Restart the background process if not already running and data exists in the queue.
- handleWaitAction() : mixed
- isInProgress() : bool
- pause() : mixed
- save() : mixed
- waitAction() : mixed
- after_task_done() : mixed
- afterComplete() : mixed
- complete() : mixed
- getWaitingActions() : array<string|int, mixed>
- handle() : bool
- Override parent method for make possible handle without wp_die in the end. Also add $this->paused to handle().
- increaseCompletedTasksCount() : mixed
- increaseTasksCount() : mixed
- is_process_running() : bool
- setCompletedTasksCount() : mixed
- setTasksCount() : mixed
Properties
$completedTasksOption
protected
mixed
$completedTasksOption
$paused
protected
bool
$paused
= false
$prefix
protected
mixed
$prefix
= 'mphb_bg'
$tasksCountOption
protected
mixed
$tasksCountOption
$waitActionsOption
protected
string
$waitActionsOption
Methods
__construct()
public
__construct() : mixed
Return values
mixed —getCompletedTasksCount()
public
getCompletedTasksCount() : int
Return values
int —getIdentifier()
public
getIdentifier() : string
Return values
string —getProgress()
public
getProgress() : float
Return values
float —The progress value in range [0; 100].
getQueueSize()
public
getQueueSize() : int
Return values
int —Only the size of the queue left to proceed (exclude completed batches).
getTasksCount()
public
getTasksCount() : int
Return values
int —handle_cron_healthcheck()
Restart the background process if not already running and data exists in the queue.
public
handle_cron_healthcheck() : mixed
Override parent method to replace each exit() with return statement.
Return values
mixed —handleWaitAction()
public
handleWaitAction() : mixed
Return values
mixed —isInProgress()
public
isInProgress() : bool
Return values
bool —pause()
public
pause() : mixed
Return values
mixed —save()
public
save() : mixed
Return values
mixed —waitAction()
public
waitAction(string $action) : mixed
Parameters
- $action : string
Return values
mixed —after_task_done()
protected
after_task_done() : mixed
Return values
mixed —afterComplete()
protected
afterComplete() : mixed
Return values
mixed —complete()
protected
complete() : mixed
Return values
mixed —getWaitingActions()
protected
getWaitingActions() : array<string|int, mixed>
Return values
array<string|int, mixed> —handle()
Override parent method for make possible handle without wp_die in the end. Also add $this->paused to handle().
protected
handle() : bool
Return values
bool —increaseCompletedTasksCount()
protected
increaseCompletedTasksCount([int $amount = 1 ]) : mixed
Parameters
- $amount : int = 1
-
Optional. 1 by default.
Return values
mixed —increaseTasksCount()
protected
increaseTasksCount(int $amount) : mixed
Parameters
- $amount : int
Return values
mixed —is_process_running()
protected
is_process_running() : bool
Return values
bool —setCompletedTasksCount()
protected
setCompletedTasksCount(int $count) : mixed
Parameters
- $count : int
Return values
mixed —setTasksCount()
protected
setTasksCount(int $count) : mixed
Parameters
- $count : int