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

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

h4kuna/queue
============

System V message queue in php.

v0.1.7(7mo ago)495MITPHPPHP &gt;=8.0CI passing

Since Jul 15Pushed 7mo ago1 watchersCompare

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

READMEChangelogDependencies (9)Versions (10)Used By (0)

Queue
=====

[](#queue)

This use native php queue [msg\_\* functions](https://www.php.net/manual/en/function.msg-get-queue.php).

### Installation by composer

[](#installation-by-composer)

`composer require h4kuna/queue`

### How to use

[](#how-to-use)

Base is [QueueFactory](src/QueueFactory.php).

```
use h4kuna\Queue;

/** @var Queue\QueueFactory $queue */
$queueFactory = new Queue\QueueFactory();

/** @var Queue\Queue $queue */
$queue = $queueFactory->create('my-queue');

$queue->producer()->send('Hello');

$queue->consumer()->receive()->message === 'Hello'
```

The messages can to have different types.

```
$queue->producer()->send('Hello', 2);
$queue->consumer()->tryReceive() === NULL // non blocking read
$queue->consumer()->receive(2)->message === 'Hello'
```

Or read all types

```
$queue->producer()->send('Hello', 2);
$queue->consumer()->receive(Queue\Config::TYPE_ALL)->message === 'Hello'
```

Limitations
-----------

[](#limitations)

This is not server, it can run as only instance on current computer.

Catch receive error
-------------------

[](#catch-receive-error)

The queue has backup implementation by [Backup](src/Backup/Filesystem.php).

```
use h4kuna\Queue;

/** @var Queue\QueueFactory $queue */
$queueFactory = new Queue\QueueFactory();

/** @var Queue\Queue $queue */
$queue = $queueFactory->create('my-queue');

$queue->restore(); // restore from backup, after restart
do {
    try {
        $message = $queue->consumer()->receive();
        // ...
    } catch (Queue\ReceiveException $e) {
        // log error
        // stop process if code is 22
    }
} while(true);
```

### List of queues

[](#list-of-queues)

```
ipcs -q
```

Error codes for receive:

- [base errors](https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno-base.h)
- [extends error](https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno.h)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance63

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Recently: every ~469 days

Total

7

Last Release

226d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.1

v0.1.4PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/54b4efb9b89167fa3598b1a41477b20387390f4a0fb65b447bd6bb7c30a49020?d=identicon)[h4kuna](/maintainers/h4kuna)

---

Top Contributors

[![h4kuna](https://avatars.githubusercontent.com/u/335722?v=4)](https://github.com/h4kuna "h4kuna (53 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/h4kuna-queue/health.svg)](https://phpackages.com/packages/h4kuna-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)
