Releases: deliciousbrains/wp-background-processing
1.4.0
What's Changed
- Updated CODEOWNERS to use jira key by @bhardie in #117
- Add Chain ID for better control of background process lifecycle by @ianmjones in #124
Full Changelog: 1.3.1...1.4.0
Chain ID
A Chain ID has been introduced that is automatically generated for each unique chain of background processes.
The Chain ID is a UUIDv4.
The Chain ID is carried across from one dispatched background process to its successor via a simple URL param in order to be as compatible as possible.
To avoid any potential WAF rules that might take offence to a chain_id
param in the URL, the default chain_id
param name can be altered via a {identifier}_chain_id_arg_name
filter.
The Chain ID is exposed to interested parties in a number of ways to allow users of the library to monitor and control the lifecycle of background processes, e.g. to ensure that only one process chain is running.
There is now a {identifier}_pre_dispatch
filter that is fired before dispatch
which can be used to cancel a dispatch
before it happens by returning true
(for cancel). The 2nd param to the new filter is the chain_id
.
The existing {identifier}_paused/resumed/cancelled/completed
actions now include the chain_id
as a param.
Similarly, the {identifier}_process_locked
and {identifier}_process_unlocked
actions now include the chain_id
as a param.
Port-forwarded Improvements
Various other improvements have been port-forwarded from use in our plugins.
- A new
get_status
function that works around issues with the options cache exists and is used byis_paused
andis_cancelled
. - The
lock_process
function now takes an optional$reset_start_time
param that istrue
by default. This is useful when you wish to refresh the lock transient to keep it alive longer without changing the start time held in the record that may be significant to a calculation. - A public
should_continue
function has been added that wraps the checks of batch limits or status change requests that mean no further processing of thetask
should continue. - A public
get_identifier
function has been added to make it easier to create hooks in plugins that use the library and validate that the process is of interest.
1.3.1
1.3.0
What's Changed
- Minimum PHP version is now 7.0
- Background processing class now accepts $allowed_classes in constructor by @eriktorsner in #112
- Minor fixes and code refactoring. by @kagg-design in #102
- Add note to README regarding PRs by @ianmjones in #108
- Increase timeout for non-blocking request. by @kagg-design in #103
New Contributors
- @kagg-design made their first contribution in #102
- @eriktorsner made their first contribution in #112
Full Changelog: 1.1.1...1.3.0
1.1.1
What's Changed
- Ensure task processing cleanly pauses or cancels as soon as possible by @ianmjones in #101
Full Changelog: 1.1.0...1.1.1
1.1.0
This release ports forward improvements made to WP Offload Media (WP Background Processing was originally extracted from it).
Improvements include:
- Incomplete batch records are updated more often for better visibility.
- It is now possible to throttle the processing to give the server a breather after each batch is processed.
- It is now possible to pause, resume and cancel a background process.
- It is now possible to check whether a background process has queued items, is running, is pausing or being cancelled, otherwise known as active.
- A background process now fires actions when it has been paused, resumed, cancelled or completed.
- It is now possible to fully clear all saved queue items.
- Adding multiple batches in the same PHP process no longer results in batches prepended with the data of previously added batches.
- Various minor improvements and updated README.
1.0.2
Tagging v1.0.2
1.0.1
Update license in composer.json