PHPackages                             arffsaad/qdiz - 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. arffsaad/qdiz

ActiveLibrary[Queues &amp; Workers](/categories/queues)

arffsaad/qdiz
=============

A simple no-framework redis queue system. Not using a framework but need a redis queue for delayed execution of long running tasks? Just qdiz (nuts).

v1.1.1(8mo ago)013GPL-3.0-onlyPHPPHP &gt;=8.0CI passing

Since Oct 17Pushed 8mo agoCompare

[ Source](https://github.com/arffsaad/qdiz)[ Packagist](https://packagist.org/packages/arffsaad/qdiz)[ RSS](/packages/arffsaad-qdiz/feed)WikiDiscussions main Synced today

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

Qdiz - A Simple No-Framework Redis Queue for PHP
================================================

[](#qdiz---a-simple-no-framework-redis-queue-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/10af0ce725e53dea9bbb7eb6ddb0addd88a570ee696c96f85e3f073c331fac24/687474703a2f2f706f7365722e707567782e6f72672f61726666736161642f7164697a2f76)](https://packagist.org/packages/arffsaad/qdiz) [![Total Downloads](https://camo.githubusercontent.com/eb97ebb02fdb8562c9202f28f3f5c85f67294e49a815055fadc010c013de8ef7/687474703a2f2f706f7365722e707567782e6f72672f61726666736161642f7164697a2f646f776e6c6f616473)](https://packagist.org/packages/arffsaad/qdiz) [![Latest Unstable Version](https://camo.githubusercontent.com/114826c5acbebd10789e1ccc5a6ac2c611ff41c4bc1a208115a327e9664e78d3/687474703a2f2f706f7365722e707567782e6f72672f61726666736161642f7164697a2f762f756e737461626c65)](https://packagist.org/packages/arffsaad/qdiz) [![License](https://camo.githubusercontent.com/a50b34cfa16bdecde5c6bb8f8565a33d1a61b2cc7e1e06e8657966b442c37148/687474703a2f2f706f7365722e707567782e6f72672f61726666736161642f7164697a2f6c6963656e7365)](https://packagist.org/packages/arffsaad/qdiz) [![PHP Version Require](https://camo.githubusercontent.com/9481011641e8f6ccff44090f26c58c2a8260b5264208eb00e7af590c1191ec64/687474703a2f2f706f7365722e707567782e6f72672f706870756e69742f61726666736161642f7164697a2f706870)](https://packagist.org/packages/arffsaad/qdiz)

> A simple, no-framework Redis queue system. Need a Redis queue for delayed execution of long-running tasks but aren't using a framework? `Just Qdiz (nuts)`.

This package provides a simple, abstract job class and a worker command to process background jobs using a Redis queue. It's designed for projects that need a lightweight job queue without the overhead of a full web framework.

Features
--------

[](#features)

- Simple, abstract job class to build your own jobs.
- CLI commands to generate job stubs and run workers.
- Automatic job retries on failure.
- Configurable max retries and "dead job" handling.
- Jobs are processed in isolated subprocesses to prevent memory leaks.

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

[](#installation)

You can install the package via Composer:

```
composer require arffsaad/qdiz

```

Configuration
-------------

[](#configuration)

The queue worker and jobs connect to Redis using environment variables. Create a .env file in the root of your project (or supply these via environment variables with the same names):

```
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

```

Usage
-----

[](#usage)

### Using Qdiz is a simple four-step process:

[](#using-qdiz-is-a-simple-four-step-process)

#### 1. Create a Job

[](#1-create-a-job)

Use the provided command to generate a new job class.

```
// Usage: vendor/bin/create-job.php  [Namespace] [OutputDirectory]
vendor/bin/create-job.php SendWelcomeEmail App\\Jobs app/Jobs

```

This will create a new file at `app/Jobs/SendWelcomeEmail.php`.

#### 2. Implement the Job Logic

[](#2-implement-the-job-logic)

Open the newly created job file and add your logic to the `onProcess()` method. This method is where your job's main task is performed. If it completes without throwing an exception, `onSuccess()` is called. If it fails, `onFail()` is called, and the job is retried.

```
