PHPackages                             bricev/jobqueue - 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. bricev/jobqueue

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

bricev/jobqueue
===============

JobQueue is a PHP component that queues `tasks` defining `jobs` which can be executed by asynchronous and/or distributed `workers`

v2.1.8(7y ago)362.4k10[1 issues](https://github.com/bricev/JobQueue/issues)MITPHPPHP ^7.1

Since Jul 1Pushed 7y ago6 watchersCompare

[ Source](https://github.com/bricev/JobQueue)[ Packagist](https://packagist.org/packages/bricev/jobqueue)[ Docs](https://github.com/bricev/JobQueue)[ RSS](/packages/bricev-jobqueue/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (19)Versions (28)Used By (0)

PHP JobQueue component
======================

[](#php-jobqueue-component)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1822d7e504b73500f70e353093ed3665036a06182d33fc0cd56ae8fcc9680b70/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6272696365762f4a6f6251756575652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bricev/JobQueue/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/73471a95c7912e2e9405e3f175c1ac6df69b20aa377824949ee085a7d60b287e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6272696365762f4a6f6251756575652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bricev/JobQueue/?branch=master)[![Build Status](https://camo.githubusercontent.com/adddb1e4ef23d49a84d810ecce4b1de417e5b1df9cd0ba5eeede9261c25b6248/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6272696365762f4a6f6251756575652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bricev/JobQueue/build-status/master)

Simple Job/Queue PHP component to help applications distribute Tasks through multiple workers.

Install
-------

[](#install)

This package is installable and auto-loadable via Composer:

```
$ composer require bricev/jobqueue
```

The application proposes a webservice and two CLIs. Read bellow for more documentation.

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

[](#configuration)

- PHP 7.1 must be installed
- Redis must be installed (for queue data persistence)
- the `JOBQUEUE_ENV` environment variable may be set as `dev`, `prod` (or any string, default if not set: `dev`)
- the `JOBQUEUE_REDIS_DSN` environment variable must define the Redis DSN (eg. 'tcp://127.0.0.1:6379')

Usage
-----

[](#usage)

### Defining a job

[](#defining-a-job)

A `job` holds the code that will be executed for tasks by a worker.

Each job must be defined in a PHP class that implements the `ExecutableJob` interface:

```
