PHPackages                             bvdputte/kirby-queue - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. bvdputte/kirby-queue

ActiveKirby-plugin[Queues &amp; Workers](/categories/queues)

bvdputte/kirby-queue
====================

A simple queue utility plugin for Kirby 3. It enables workers in Kirby that can do tasks (in the background) at scheduled intervals (cron) by working through queues of jobs.

1.0.4(3y ago)314.6k3[4 issues](https://github.com/bvdputte/kirby-queue/issues)[2 PRs](https://github.com/bvdputte/kirby-queue/pulls)MITPHP

Since Mar 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/bvdputte/kirby-queue)[ Packagist](https://packagist.org/packages/bvdputte/kirby-queue)[ RSS](/packages/bvdputte-kirby-queue/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Kirby queue plugin
==================

[](#kirby-queue-plugin)

A simple queue utility plugin for Kirby 3. It enables workers in Kirby that can do tasks (in the background) at scheduled intervals (cron) by working through queues of jobs.

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

[](#installation)

- unzip [master.zip](https://github.com/bvdputte/kirby-queue/archive/master.zip) as folder `site/plugins/kirby-queue` or
- `git submodule add https://github.com/bvdputte/kirby-queue.git site/plugins/kirby-fingerprint` or
- `composer require bvdputte/kirby-queue`

Usage
-----

[](#usage)

### Setup worker

[](#setup-worker)

#### 1. Via Cron

[](#1-via-cron)

Add the worker file `site/plugins/kirby-queue/worker.php` to [cron](https://en.wikipedia.org/wiki/Cron) or similar at the desired interval (.e.g. each minute).

💡 This is the preferred method for setting up kirby-queue.

#### 2. Route

[](#2-route)

There's also a route available at `kqueueworker-supersecreturlkey` that you can trigger to work the queues. The URL can be adjusted [via the options](#options-and-opinionated-defaults).

#### 3. Poor man's cron

[](#3-poor-mans-cron)

When cron is not installed on your server, you can also *fake* cron by enabling `option("bvdputte.kirbyqueue.poormanscron", true);`.

The default interval for *poor man's cron* is 60sec. You can change this with `option("bvdputte.kirbyqueue.poormanscron.interval", 60*60);` to hourly e.g.

### Custom worker(s)

[](#custom-workers)

If you need your own worker logic (*e.g. workers that need to run at different intervals*), you can create your custom worker by extending the `Queueworker` class.

### Define queues

[](#define-queues)

Queues are defined in the config file. Pass them as an associative array: `[name] => function handler($job) {}`. The handler is a closure that is being called to process job by the worker.

```
'bvdputte.kirbyqueue.queues' => [
    'queuename' => function($job) {

        // Get your data
        $foo = $job->get('foo');
        $bar = $job->get('bar');

        // Do something with your data, for example: send something to kirbylog
        try {
            kirbylog("test")->log($foo . " " . $bar);
        } catch (Exception $e) {
            // Throw an error to fail a job
            throw new Exception($e->getMessage());
            // or just return false, but setting a message for the user is better.
        }

        // No need to return or display anything else!
    }
],
```

- 💡 You can define as many queues as you need, but each queue only has 1 handler.
- 💡 The queues will be worked through in the order as defined in the `queues` option.

### Add jobs

[](#add-jobs)

```
$myQueue = kqQueue("queuename"); // "queuename must be the same as set in the options
$myJob = kqJob([ // Pass the variables needed in the handler
    'foo' => "foo",
    'bar' => "bar"
]);
$myQueue->addJob($myJob);
```

### Schedule jobs

[](#schedule-jobs)

```
$tomorrow = new DateTime('tomorrow');
$myJob->setDueDate($tomorrow->getTimestamp());
```

You can also define a "due date" (UNIX Timestamp) for your job. Your job will be ignored until then.

💡 Take into account the interval you've defined to trigger your worker, as due dates only get be checked when the worker is working through the queue.

Options and opinionated defaults
--------------------------------

[](#options-and-opinionated-defaults)

```
option("bvdputte.kirbyqueue.roots");
```

The default folder name for the queues is `queues`. This will be placed in the `/site/` folder. Each queue will get its own subfolder with its name as foldername.

```
option("bvdputte.kirbyqueue.worker.route");
```

The URL for the route to trigger the built in worker. Might be useful if you want to trigger the worker via an URL. Be sure to add a secret hash to it so it can't be used as an attack vector.

Disclaimer
----------

[](#disclaimer)

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please [create a new issue](https://github.com/bvdputte/kirby-queue/issues/new).

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~320 days

Total

5

Last Release

1378d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/490505?v=4)[Bart Vandeputte](/maintainers/bvdputte)[@bvdputte](https://github.com/bvdputte)

---

Top Contributors

[![bvdputte](https://avatars.githubusercontent.com/u/490505?v=4)](https://github.com/bvdputte "bvdputte (3 commits)")[![teichsta](https://avatars.githubusercontent.com/u/2108636?v=4)](https://github.com/teichsta "teichsta (1 commits)")

---

Tags

queuecronTasksworkerskirby3background taskskirby3-plugin

### Embed Badge

![Health badge](/badges/bvdputte-kirby-queue/health.svg)

```
[![Health](https://phpackages.com/badges/bvdputte-kirby-queue/health.svg)](https://phpackages.com/packages/bvdputte-kirby-queue)
```

###  Alternatives

[jms/job-queue-bundle

Allows to run and schedule Symfony console commands as background jobs.

3452.3M5](/packages/jms-job-queue-bundle)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[bvdputte/kirby-autopublish

Kirby plugin to schedule the automatic publishing of pages on a certain date+time. It is built to work with enabled cache.

359.2k](/packages/bvdputte-kirby-autopublish)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4044.1k5](/packages/orisai-scheduler)[g4/tasker

Application asynchronous tasks manager and runner, cron-like PHP implementation with ability to run tasks with resolution in seconds

1455.7k](/packages/g4-tasker)[matviib/scheduler

Service for scheduling and managing cron tasks in laravel application

213.3k](/packages/matviib-scheduler)

PHPackages © 2026

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