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

ActiveCradle-package[Queues &amp; Workers](/categories/queues)

cradlephp/cradle-queue
======================

AMQ handler for Cradle

2.3.0(5y ago)01.0k1[1 issues](https://github.com/CradlePHP/cradle-queue/issues)2MITPHP

Since Mar 12Pushed 5y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (5)Versions (12)Used By (2)

cradle-queue
============

[](#cradle-queue)

RabbitMQ with Fork and Exec workers. Built for the [Cradle Framework](https://cradlephp.github.io/)

Install
-------

[](#install)

If you already installed Cradle, you may not need to install this because it should be already included.

```
composer require cradlephp/cradle-queue
bin/cradle cradlephp/cradle-queue install

```

Setup
-----

[](#setup)

Open `/config/services.php` and add

```
'rabbitmq-main' => [
    'host' => '127.0.0.1',
    'port' => 5672,
    'user' => 'guest',
    'pass' => 'guest'
],

```

Methods
-------

[](#methods)

```
cradle('cradlephp/cradle-queue')->queue(*string $event, array $data);

```

An easy way to queue.

```
cradle('cradlephp/cradle-queue')
    ->queue()
    ->setData(*array $data)
    ->setDelay(*string $delay)
    ->setPriority(*int $priority)
    ->setQueue(*string $queueName)
    ->setRetry(*int $retry)
    ->send(*string $task, bool $duplicates = true);

```

Returns the queue class for advance manipulation. If you want to prevent duplicates from entering your queue, set the `$duplicates` flag to false and turn on Redis (this is the only way I can figure this can happen).

CommandLine
-----------

[](#commandline)

You can queue events via command line like the following example.

```
$ cradle queue event-name foo=bar zoo=foo
```

To start a worker use any of the following commands.

```
$ cradle work
$ cradle work --mode exec
$ cradle work --mode fork
```

- `cradle work --mode exec` - Uses `exec()` to work on tasks. This is used incase you want to manage your background process
- `cradle work --mode fork` - Uses `pntl_fork` to work on tasks. This is another way to manage your background process

---

Contributing to Cradle PHP
==========================

[](#contributing-to-cradle-php)

Thank you for considering to contribute to Cradle PHP.

Please DO NOT create issues in this repository. The official issue tracker is located @  . Any issues created here will *most likely* be ignored.

Please be aware that master branch contains all edge releases of the current version. Please check the version you are working with and find the corresponding branch. For example `v1.1.1` can be in the `1.1` branch.

Bug fixes will be reviewed as soon as possible. Minor features will also be considered, but give me time to review it and get back to you. Major features will **only** be considered on the `master` branch.

1. Fork the Repository.
2. Fire up your local terminal and switch to the version you would like to contribute to.
3. Make your changes.
4. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

Making pull requests
--------------------

[](#making-pull-requests)

1. Please ensure to run [phpunit](https://phpunit.de/) and [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) before making a pull request.
2. Push your code to your remote forked version.
3. Go back to your forked version on GitHub and submit a pull request.
4. All pull requests will be passed to [Travis CI](https://travis-ci.org/CradlePHP/cradle-queue) to be tested. Also note that [Coveralls](https://coveralls.io/github/CradlePHP/cradle-queue) is also used to analyze the coverage of your contribution.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

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

Recently: every ~106 days

Total

11

Last Release

2154d ago

Major Versions

0.0.3 → 2.1.x-dev2019-01-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120378?v=4)[Christian Blanquera](/maintainers/cblanquera)[@cblanquera](https://github.com/cblanquera)

---

Tags

amqpcradlecradlephprabbitmqv2workerscradlecradlephp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)[jwage/phpamqplib-messenger

Symfony messenger transport for the php-amqplib/php-amqplib library.

84149.7k1](/packages/jwage-phpamqplib-messenger)[convenia/pigeon

3233.0k](/packages/convenia-pigeon)

PHPackages © 2026

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