PHPackages                             neophp/queue-package - 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. neophp/queue-package

ActiveLibrary

neophp/queue-package
====================

Simple database-backed job queue for NeoPHP, processed via a batch worker command

v0.3.0(today)01↑2900%MITPHPPHP &gt;=8.5CI passing

Since Aug 9Pushed todayCompare

[ Source](https://github.com/NeoPHP-Dev/neo-queue-package)[ Packagist](https://packagist.org/packages/neophp/queue-package)[ RSS](/packages/neophp-queue-package/feed)WikiDiscussions main Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Queue Package
=============

[](#queue-package)

A simple, database-backed job queue for NeoPHP. Push jobs, process them in batches via a worker command triggered by a system cron — no long-running process, no external dependency like Redis or a message broker.

---

Structure
---------

[](#structure)

```
queue-package/
├── composer.json
├── README.md
├── src/
│   ├── NeoQueuePackage.php
│   ├── Commands/
│   │   ├── QueueWorkCommand.php
│   │   ├── QueueRetryCommand.php
│   │   └── MakeJobCommand.php
│   ├── Service/
│   │   └── QueueManager.php
│   └── Interface/
│       └── JobInterface.php
└── database/
    ├── Entity/
    │   └── QueueJob.php
    ├── Repository/
    │   └── QueueJobRepository.php
    └── Migrations/
        └── MigrationVersion_Queue_1.php

```

---

How it works
------------

[](#how-it-works)

Jobs are stored as rows in `neo_queue_jobs` — no long-running worker process, no Supervisor/systemd setup required. Instead, a system cron calls `queue:work` on a schedule (typically every minute); each run picks up a batch of due jobs, processes them, and exits.

```
* * * * * php /path/to/bin/neo queue:work --project=MyProject >> /dev/null 2>&1
```

If a job throws, it's automatically retried with exponential backoff (1 minute, then 5 minutes) up to 3 attempts total, after which it's marked permanently `failed` and left for manual inspection.

---

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

[](#installation)

```
php bin/neo package:require neophp/queue-package --project=MyProject
```

Register it in the project's `Config/app.config.php`:

```
return [
    // ...
    'packages' => [
        \Vendor\NeoPHP\QueuePackage\NeoQueuePackage::class,
    ],
];
```

Run the migration:

```
php bin/neo database:migration:migrate --project=MyProject
```

---

Creating a job
--------------

[](#creating-a-job)

```
php bin/neo make:job SendWelcomeEmail --project=MyProject
```

Generates `src/MyProject/App/Jobs/SendWelcomeEmailJob.php`:

```
