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

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

mallabee/queue
==============

Framework agnostic background task queue management for Beanstalkd, SQS, Redis. Easy to use in pure PHP, Symfony, Laravel, Yii2 projects. Based on illuminate/queue (Laravel Queues).

1.1.6(7y ago)251.2kMITPHPPHP ^7.1

Since Oct 10Pushed 7y ago3 watchersCompare

[ Source](https://github.com/mallabee/queue)[ Packagist](https://packagist.org/packages/mallabee/queue)[ Docs](https://www.mallabee.com)[ RSS](/packages/mallabee-queue/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (9)Versions (10)Used By (0)

Date updated: February 21, 201.

State: Still Active.

Leaning on (including) `illuminate/queue` version: 5.7.27

What?
-----

[](#what)

Framework agnostic background task queue management for Beanstalkd, SQS. Easy to use in pure PHP, Symfony, Laravel, Yii2 projects. Based on illuminate/queue (Laravel Queues).

A background task management using multiple drivers with ability to register custom drivers.

What is a background task management? simple words - offloading work to background jobs. read more:

Why?
----

[](#why)

We faced a problem needing a queue management for a Symfony side-project and a pure PHP project that has a framework agnostic approach in mind. This means - low, if at all amount of dependencies.

The available popular packages at that time were:

- `illuminate/queue` (Laravel Framework, which is available for standalone as can be seen in [here](https://github.com/mattstauffer/Torch/tree/master/components/queue), the problem is the amount of bloated dependencies \[e.g.: "illuminate/console", "illuminate/container", "illuminate/contracts", "illuminate/database", "illuminate/events", "illuminate/filesystem", "illuminate/pagination", "illuminate/support": "5.8.\*"\]).
- `yiisoft/yii2-queue` (which is bound to the Yii Framework).

As each package had it's problems, we sat to create this library - a framework agnostic, queue background task management, available for use for pure PHP projects as well.

How?
----

[](#how)

ENTER - Mallabee Queue a.k.a MQ / MQueue (by [mallabee.com](https://www.mallabee.com))

By leveraging the understanding of queues, best practices and ease of use from multiple libraries such as `yiisoft/yii2-queue`, `illuminate/queue`.

We have taken the `illuminate/queue` package and highly modified it, so take a note as we are leaning on that when we develop new features and maintain this package.

Advantages / Features:

- Framework agnostic - use in pure PHP projects, Symfony, Laravel, Yii, Zend, anything you wish.
- Register custom drivers.
- Allow usage of custom serializer/de-serializer (like `jms/serializer`) when encoding/decoding jobs payloads via a container, if not provided - uses `json_encode`, `json_decode`.

Usage
-----

[](#usage)

First thing to know is that most of the missing information you can find at `illuminate/queue` docs as our package is pretty similar (although with some changes):

### What will you need/might need to know to start

[](#what-will-you-needmight-need-to-know-to-start)

- Basic PHP understanding.
- What is queue management &amp; background jobs.
- Beanstalkd (more read about queuing: ).
- Amazon SQS.
- Event Dispatcher.
- Container.
- Supervisord.
- Serializer / De-serializer.

### Seeding work to Queue Manager

[](#seeding-work-to-queue-manager)

To start, create a new Queue manager instance.

```
use Mallabee\Queue\Core\Manager as Queue;

$queue = new Queue;

$instance = $queue->configure('beanstalkd', [
    'host' => 'localhost',
    'queue' => 'default',
]);

// If you like - set last configured instance as global
$queue->setAsGlobal();
```

Once the instance has been registered and configured. You may use it like so to seed new jobs:

```
// As an instance...
$queue->push('SendEmail', array('message' => $message));

// If setAsGlobal has been called...
Queue::push('SendEmail', array('message' => $message));
```

### Registering a custom queue handler driver

[](#registering-a-custom-queue-handler-driver)

As default - we have provided you with popular queue drivers default out of the box, this includes:

- Beanstalkd
- Amazon SQS
- Redis (Currently **not implemented** yet because requires migrating of `illuminate/redis` package)

If you would like to create your own custom queue - follow these queues folders and create your custom queue driver.

**Note:** Make sure all your connector, driver and job files are inside same folder

Then when you have the driver ready, use it by registering and configuring it like so:

```
use Mallabee\Queue\Core\Manager as Queue;

$queue = new Queue;

$this->registerDriver('mycustomdriver', new \Drivers\MyCustomDriver\MyCustomDriverConnector());

$instance = $queue->configure('mycustomdriver', [
    'host' => 'localhost',
    'queue' => 'default',
]);

// If you like - set last configured instance as global
$queue->setAsGlobal();
```

### Using the queue and processing work via the Worker

[](#using-the-queue-and-processing-work-via-the-worker)

Advise the demo app that is located under `example` folder to understand how you can pull jobs from the queue and process them.

There are multiple folders in there - we suggest to start with `ExampleEasy` to get an understanding, this example interacts with `beanstalkd` for the queue management.

### Traits and their usage

[](#traits-and-their-usage)

#### InteractsWithQueue (Job trait)

[](#interactswithqueue-job-trait)

- Allows a job to interact with the queue - delete a job, etc..

#### JobUtils (Job trait)

[](#jobutils-job-trait)

- Populate the job parameters with ease. Helps when you want to easily interact with the parameters (due to ability to decide the parameters types).

### Passing your Container, Event Dispatcher, Logger, Exception Handler, Serializer

[](#passing-your-container-event-dispatcher-logger-exception-handler-serializer)

#### Container

[](#container)

We are using the popular PSR container interface.

The container is passed to the job in-order to allow you to get your dependencies easily.

Also - it's used for custom serializing / de-serializing of the job payload.

Currently supported containers:

- PSR complaint: Symfony, Laravel, etc..

#### Event Dispatcher

[](#event-dispatcher)

Notice that we only use the `listen` &amp; `dispatch` of the interface, no need to implement anything else.

Currently supported containers:

- `league/event` (via the `CommonAdapters`).

#### Logger

[](#logger)

We are using the popular PSR logger interface.

Used in the queue utils.

Currently supported containers:

- PSR complaint.

#### Serializer - Serializing (encoding) / De-serializing (decoding) job payloads with a custom serializer

[](#serializer---serializing-encoding--de-serializing-decoding-job-payloads-with-a-custom-serializer)

You are able to serializer / de-serialize a job payload via a custom serializer such as JMS serializer (`jms/serializer`) and Symfony Serializer.

This allows you to better control the final object of the payload that will be registered to the queue or passed as payload to the job when it's being processed.

To do so you will have to use a container which has a key called `job_serializer`.

The serializer must implement the `JobSerializerInterface`.

See the demo for example of how it's actually done.

**Note:** The de-serializing process is a tad slower than the conventional &amp; standard `json_encode`, `json_decode` way.

Currently supported containers:

- `jms/serializer` (via the `CommonAdapters`).

### Definitions

[](#definitions)

- Manager/Queue Manager (sometimes referred to as Queue) - The manager that registers drivers, connect to the queue, pushes/seeds jobs to the queue.
- Seeder - A script that creates a job(s) and adds it to the queue.
- Worker - The worker that pulls jobs from queue, fire relevant events.
- Job - The work that needs to be done.
- Connection - A queue connection.
- Queue - A queue.
- Driver/Adapter - A driver is the way to interact with new queue type (e.g.: Beanstalkd, SQS, Redis, Database).
- Connector - A driver connector is the class that makes the connection between a queue configuration and a driver and generate an instance.
- Event - An event is fired when relevant stuff happens (such as job processed, job failed). You can listen to these events and interact with the queue while they occur.
- Queue Utils - sometimes it happens that a driver have implementation / ideas that other drivers don't share with it, this is the place to put them.

### Best practices for background task management

[](#best-practices-for-background-task-management)

- Why not daemonizing a PHP script? - PHP is not good for long background processes - read more:
- Why not using `crontab` to run the worker? cron can only generate a worker each one minute at minimum.

MQ and Laravel Queues (`illuminate/queue`)
------------------------------------------

[](#mq-and-laravel-queues-illuminatequeue)

### Main differences between MQ and Laravel Queues (`illuminate/queue`)

[](#main-differences-between-mq-and-laravel-queues-illuminatequeue)

- Folder structure.
- Container can be null, not a must and not passed.
- `QueueManager` and `Manager` are combined into one class `Manager`.
- There is `QueueUtils` allowing you to handle specific driver/adapter functionalities/implementations.
- Event dispatcher is not a must - if no event dispatcher is used - a null dispatcher will be used.
- The way we register handlers.
- `Worker->getNextJob()` - public instead of private, because maybe you just want to peek on a job.
- `Manager` isDownForMaintenance instead of using Capsule.
- `Manager` addition of `$drivers` property, `registerDefaultDrivers`, `registerDriver` and `configure` functions.
- `ExceptionHandlerInterface` instead of using Symfony `ExceptionHandler` directly.
- In general - interfaces &amp; null dummies for everything that isn't a must.
- Default of connection.
- `FailingJob` was merged to `Worker`-&gt;`failJob`.
- `Str` &amp; `Arr` helper classes - took only needed functions.
- Allow usage of custom serializer/de-serializer for job encode/decode.

### Structural difference

[](#structural-difference)

Was in place (`illuminate/queue`)New place in MQCapsule\\Manager / QueueManagerCore\\ManagerQueueCore\\QueueWorkerCore\\WorkerWorkerOptionsCore\\WorkerOptions### Missing implementations

[](#missing-implementations)

- `SerializesModels` &amp; `SerializesAndRestoresModelIdentifiers` traits - they are using `Eloquent` models and are specific for Laravel.

Contribute
----------

[](#contribute)

Contribution is highly appreciated.

Please follow the [Contribution Guide](CONTRIBUTING.md) before contributing.

Here's what we are missing:

- Drivers/Adapters for different queue management (Database \[without Doctrine or any other ORM, using PDO\], etc..).
- Event Dispatcher Adapters for different event dispatcher libraries.
- Container Adapters for e.g.: Symfony, Laravel, Slim, Zend, Yii.
- Job Serializers Adapters e.g.: JMS Serializer, Symfony Serializer.
- Bundles for e.g.: Symfony, Laravel, Slim, Zend, Yii.
- Documentation.
- Testing.
- Making sure all the features of `illuminate/queue` work in here too.
- Battle test the library with different production scenarios.
- Remove the dependency of Carbon.
- Haven't yet actually tested `SQS` &amp; `Redis` queues.

#### Fix required

[](#fix-required)

- `FailingJob` is missing.
- Add `redis` as default driver.
- Check what is `createObjectPayload` in `Queue` and check if there's an illuminate dependency there that requires a conversion.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~19 days

Recently: every ~33 days

Total

8

Last Release

2687d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2164032?v=4)[Din Bracha](/maintainers/dinbrca)[@dinbrca](https://github.com/dinbrca)

---

Top Contributors

[![dinbrca](https://avatars.githubusercontent.com/u/2164032?v=4)](https://github.com/dinbrca "dinbrca (41 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.6k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k48](/packages/ecotone-ecotone)[oro/platform

Business Application Platform (BAP)

645143.5k114](/packages/oro-platform)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

187557.3k2](/packages/wikimedia-parsoid)

PHPackages © 2026

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