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

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

locomotivemtl/charcoal-queue
============================

Queue, Queue items and Queueable objects for Charcoal

0.5.0(5y ago)014.3k1MITPHPPHP &gt;=5.6.0CI failing

Since May 19Pushed 4y ago12 watchersCompare

[ Source](https://github.com/locomotivemtl/charcoal-queue)[ Packagist](https://packagist.org/packages/locomotivemtl/charcoal-queue)[ Docs](https://charcoal.locomotive.ca)[ RSS](/packages/locomotivemtl-charcoal-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (6)Versions (10)Used By (1)

Charcoal Queue
==============

[](#charcoal-queue)

Queue Managers, Queue Items and Queueable objects (through Interface &amp; Trait) for Charcoal.

How to install
--------------

[](#how-to-install)

```
composer require locomotivemtl/charcoal-queue`

```

Dependencies
------------

[](#dependencies)

- `locomotivemtl/charcoal-core` for the `CollectionLoader`
- `locomotivemtl/charcoal-factory` for the queue-item factory.

Queueing System
---------------

[](#queueing-system)

Queue managers loop queue items. Queue items represent actions to be performed (as defined by the `process()` method).

Queue Manager
-------------

[](#queue-manager)

The queue manager is available as an abstract class: `AbstractQueueManager`. This class implements the `QueueManagerInterface`.

The processing speed (throttle) can be controlled via the `rate` property, in items per second.

The batch limit (number of items to process per iteration) can be controlled with the `limit` property.

The queue can be identified with the `queue_id`. It can be set with `setQueueId()`.

The queue can be processed with `processQueue()`. If for any reason the items need to be loaded, it can be done with `loadQueueItems()`.

There are 4 callbacks that can be defined:

- `setProcessedCallback()`
- `setItemCallback()`
- `setItemSuccessCallbak()`
- `setItemFailureCallback()`

There are only 1 abstract method:

- `queueItemProto()` which must returns a `QueueItemInterface` instance

Queue Items
-----------

[](#queue-items)

Queue Items should implement the `QueueItemInterface`. This can be helped via the `QueueItemTrait`.

Queue items can be identified with a `queue_id`. (The same `queue_id` used by the queue manager).

Items can be processed with `process($callback, $successCallback, $failureCallback)`.

The queue item properties are:

- `queue_id`
- `queue_item_data`
- `queued_date`
- `processing_date`
- `processed_date`
- `processed`

Queuable Objects
----------------

[](#queuable-objects)

The `QueueableInterface` defines objects that can be queued. This interface is really simple and only provides:

- `setQueueId()` which can be inherited from `QueueableTrait`
- `queueId()` (`queue_id` getter) which can be inherited from `QueueableTrait`
- `queue($ts = null)` which is abstract and must be written inside class which implement the queueable interface

Development
===========

[](#development)

To install the development environment:

```
$ composer install --prefer-source
```

Run tests with

```
$ composer test
```

API documentation
-----------------

[](#api-documentation)

- The auto-generated `phpDocumentor` API documentation is available at
- The auto-generated `apigen` API documentation is available at [https://codedoc.pub/locomotivemtl/charcoal-queue/master/](https://codedoc.pub/locomotivemtl/charcoal-queue/master/index.html)

Development dependencies
------------------------

[](#development-dependencies)

- `phpunit/phpunit`
- `squizlabs/php_codesniffer`
- `php-coveralls/php-coveralls`

Continuous Integration
----------------------

[](#continuous-integration)

ServiceBadgeDescription[Travis](https://travis-ci.org/locomotivemtl/charcoal-queue)[![Build Status](https://camo.githubusercontent.com/64af67dfe56427a70246e5c463934b77349abbb7762c64a615b7199f2b4f3596/68747470733a2f2f7472617669732d63692e6f72672f6c6f636f6d6f746976656d746c2f63686172636f616c2d71756575652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/locomotivemtl/charcoal-queue)Runs code sniff check and unit tests. Auto-generates API documentation.[Scrutinizer](https://scrutinizer-ci.com/g/locomotivemtl/charcoal-queue/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6a2a6af3c5b4cdc9c429666cc0ad37bc27a66f786caafb99292feffd803f2c32/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c6f636f6d6f746976656d746c2f63686172636f616c2d71756575652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/locomotivemtl/charcoal-queue/?branch=master)Code quality checker. Also validates API documentation quality.[Coveralls](https://coveralls.io/github/locomotivemtl/charcoal-queue)[![Coverage Status](https://camo.githubusercontent.com/2c8e2e0e2ec3ada4a241ca840a4a2748f3b3a1c22863ef6c30c0d60a905e73ba/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6f636f6d6f746976656d746c2f63686172636f616c2d71756575652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/locomotivemtl/charcoal-queue?branch=master)Unit Tests code coverage.[Sensiolabs](https://insight.sensiolabs.com/projects/54cd0da0-455a-479e-81e2-7e5be346b6fd)[![SensioLabsInsight](https://camo.githubusercontent.com/1ecd78fa8ed642526c72c69a33ae3dbf10dd273cc302e6a5167f721e7345e55b/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35633231613163662d396232312d343163382d383261382d3930666261643830386132302f6d696e692e706e67)](https://insight.sensiolabs.com/projects/54cd0da0-455a-479e-81e2-7e5be346b6fd)Another code quality checker, focused on PHP.Coding Style
------------

[](#coding-style)

The Charcoal-Validator module follows the Charcoal coding-style:

- [*PSR-1*](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
- [*PSR-2*](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
- [*PSR-4*](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md), autoloading is therefore provided by *Composer*.
- [*phpDocumentor*](http://phpdoc.org/) comments.
- Read the [phpcs.xml](phpcs.xml) file for all the details on code style.

> Coding style validation / enforcement can be performed with `composer phpcs`. An auto-fixer is also available with `composer phpcbf`.

Authors
-------

[](#authors)

- Mathieu Ducharme

License
=======

[](#license)

Charcoal is licensed under the MIT license. See [LICENSE](LICENSE) for details.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~175 days

Total

9

Last Release

2070d ago

PHP version history (2 changes)0.1PHP &gt;=5.5.0

0.2PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfb071c0ff7ce9500c528a003a2c53124248debc3e5bf367c17f89f5e6136125?d=identicon)[mducharme](/maintainers/mducharme)

---

Top Contributors

[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (28 commits)")[![mducharme](https://avatars.githubusercontent.com/u/12157?v=4)](https://github.com/mducharme "mducharme (22 commits)")[![JoelAlphonso](https://avatars.githubusercontent.com/u/10762266?v=4)](https://github.com/JoelAlphonso "JoelAlphonso (12 commits)")[![losted](https://avatars.githubusercontent.com/u/165665?v=4)](https://github.com/losted "losted (2 commits)")

---

Tags

queuecharcoal

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[php-amqplib/rabbitmq-bundle

Integrates php-amqplib with Symfony &amp; RabbitMq. Formerly emag-tech-labs/rabbitmq-bundle, oldsound/rabbitmq-bundle.

1.3k20.1M65](/packages/php-amqplib-rabbitmq-bundle)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[swarrot/swarrot

A simple lib to consume RabbitMQ queues

3654.4M8](/packages/swarrot-swarrot)[koco/messenger-kafka

Symfony Messenger Kafka Transport

931.1M1](/packages/koco-messenger-kafka)[josegonzalez/queuesadilla

Queue background jobs to any backend system

96508.2k2](/packages/josegonzalez-queuesadilla)[prolic/humus-amqp

PHP-AMQP library with RabbitMQ Extensions

76205.4k5](/packages/prolic-humus-amqp)

PHPackages © 2026

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