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

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

crysalead/queue
===============

Simple queue consumer framework that supports message dispatching.

19.4k↓26.9%PHP

Since May 23Pushed 12mo ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Queue
=====

[](#queue)

[![Build Status](https://camo.githubusercontent.com/172b51049dd062f4cc20e89d0473fc7c36d868b4fee23fb7e83413a277c9d24d/68747470733a2f2f7472617669732d63692e636f6d2f63727973616c6561642f71756575652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/crysalead/queue)

Install
-------

[](#install)

```
composer require crysalead/queue
```

Basic usage
-----------

[](#basic-usage)

### Create Queue instance

[](#create-queue-instance)

```
$broker = new Lead\Queue\Adapter\Sqs(
    "https://queue.url",
    new SqsClient([
        'version' => 'latest',
        'region' => '',
        'credentials' => [
            'key'=> '',
            'secret'=>''
        ]
    ])
);
```

### Listen on queue

[](#listen-on-queue)

Listening is a **blocking** call and runs in an infinite loop (up to default 20s polling timout). Your callback will be triggered when a new Message has arrived.

```
$broker->listen(function($job) {

	if (!$job) {
		return;
	}
	/**
	 *
	 *  Process the job...
	 *
	 */

	// Delete the job from Queue.
	$job->delete();

});
```

### Shutting down the Queue

[](#shutting-down-the-queue)

You may shutdown the queue by using the `shutdown()` method.

The Queue instance will respond to PCNTL signals in a safe manner that will not interrupt in the middle of Message processing. You can install signal handlers in your code to cleanly and safely shutdown the service.

```
pcntl_signal(
	SIGINT,
	function() use ($broker) {
		$broker->shutdown();

	}
);
```

### Acknowledgements

[](#acknowledgements)

- [Syndicate](https://github.com/nimbly/Syndicate) (this repo is a simple fork of his brillant work).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/67c78f317fdfb9f077b1f16c88193192f7562e999c536b25943b759c3b5099fb?d=identicon)[jails](/maintainers/jails)

---

Top Contributors

[![jails](https://avatars.githubusercontent.com/u/1306941?v=4)](https://github.com/jails "jails (7 commits)")

### Embed Badge

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

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2228.8M171](/packages/react-async)[react/promise-stream

The missing link between Promise-land and Stream-land for ReactPHP

11512.9M45](/packages/react-promise-stream)[illuminate/bus

The Illuminate Bus package.

6043.8M409](/packages/illuminate-bus)

PHPackages © 2026

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