PHPackages                             underpin/background-process-loader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. underpin/background-process-loader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

underpin/background-process-loader
==================================

Asynchronous, background process loader for Underpin.

1.1.0(4y ago)119[2 issues](https://github.com/Underpin-WP/background-process-loader/issues)GPL-2.0-or-laterPHP

Since Jul 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Underpin-WP/background-process-loader)[ Packagist](https://packagist.org/packages/underpin/background-process-loader)[ RSS](/packages/underpin-background-process-loader/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Underpin Background\_Processes Extension
========================================

[](#underpin-background_processes-extension)

[Background Processing](https://github.com/deliciousbrains/wp-background-processing) Integration for the [Underpin](https://github.com/underpin-wp/underpin) WordPress framework.

As originally described by Delicious Brains:

> WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks. Check out the example plugin or read the accompanying article.

Benefits of using this inside Underpin:

1. Everything works inside of Underpin's registry, which works quite well with how Background Processing works.
2. Underpin extends Background Processing to use Underpin's event logging.

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

`composer require underpin/background-process-loader`

### Manually

[](#manually)

This plugin uses a built-in autoloader, so as long as [Background Processing](https://github.com/deliciousbrains/wp-background-processing) is required *before*this extension, it should work as-expected.

`require_once(__DIR__ . '/underpin-background-processes/underpin-background-process.php');`

Setup
-----

[](#setup)

1. Install this loader.
2. Install Underpin. See [Underpin Docs](https://www.github.com/underpin-wp/underpin)
3. Create `Background_Process` or `Async_Request` classes.
4. Register processes using Underpin.

Working With Async Tasks
------------------------

[](#working-with-async-tasks)

From Delicious Brains:

> Async requests are useful for pushing slow one-off tasks such as sending emails to a background process. Once the request has been dispatched it will process in the background instantly.

```
underpin()->async_requests()->add( 'key', [
	'action'               => 'key',        // Action Name. Must be unique.
	'task_action_callback' => function () { // Callback to fire
		// do things
	},
] );
```

Alternatively, you can extend `Async_Request` and reference the extended class directly, like so:

```
underpin()->async_request()->add('key','Namespace\To\Class');
```

Once registered, you can run the action any time like so:

```
underpin()->async_requests()->dispatch( 'key' );
```

Working With Background Processes
---------------------------------

[](#working-with-background-processes)

From Delicious Brains:

> Background processes work in a similar fashion to async requests but they allow you to queue tasks. Items pushed onto the queue will be processed in the background once the queue has been dispatched. Queues will also scale based on available server resources, so higher end servers will process more items per batch. Once a batch has completed the next batch will start instantly.

> Health checks run by default every 5 minutes to ensure the queue is running when queued items exist. If the queue has failed it will be restarted.

> Queues work on a first in first out basis, which allows additional items to be pushed to the queue even if it’s already processing.

You can register a background process directly just like any other loader, like so:

```
underpin()->background_processes()->add( 'example', [
	'action'               => 'example_action_name', // Action Name. Must be unique.
	'task_action_callback' => function ( $item ) {   // Callback to fire on a single item.
	  // Do an action
	},
] );
```

`task_action_callback` should contain any logic to perform on the queued item. Return false to remove the item from the queue or return $item to push it back onto the queue for further processing. If the item has been modified and is pushed back onto the queue the current state will be saved before the batch is exited.

Alternatively, you can extend `Background_Process` and reference the extended class directly, like so:

```
underpin()->background_processes()->add('key','Namespace\To\Class');
```

Once registered, you can add as many items as necessary to the queue:

```
underpin()->background_processes()->enqueue( 'key', ['args' => 'to pass to task_action_callback'] );
```

Finally, when you're done enqueueing items, you can dispatch the processor to run the process on each enqueued item:

```
underpin()->background_processes()->dispatch( 'key' );
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~64 days

Total

3

Last Release

1637d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e6206223bd6f2a57b8ac80605b1b5c3521faaec18ad3f20f25fb728a9a13784?d=identicon)[tstandiford](/maintainers/tstandiford)

---

Top Contributors

[![alexstandiford](https://avatars.githubusercontent.com/u/8210827?v=4)](https://github.com/alexstandiford "alexstandiford (8 commits)")

---

Tags

background-jobsbackground-taskbackground-threadhacktoberfestunderpinwordpress

### Embed Badge

![Health badge](/badges/underpin-background-process-loader/health.svg)

```
[![Health](https://phpackages.com/badges/underpin-background-process-loader/health.svg)](https://phpackages.com/packages/underpin-background-process-loader)
```

###  Alternatives

[spatie/laravel-schedule-monitor

Monitor scheduled tasks in a Laravel app

9815.7M9](/packages/spatie-laravel-schedule-monitor)[zetacomponents/system-information

Provides access to common system variables, such as CPU type and speed, and the available amount of memory.

221.9M18](/packages/zetacomponents-system-information)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
