PHPackages                             mombol/php-file-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. mombol/php-file-queue

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

mombol/php-file-queue
=====================

A PHP file queue

v1.2.2(9y ago)7967PHP

Since Jun 14Pushed 9y ago2 watchersCompare

[ Source](https://github.com/mombol/php-file-queue)[ Packagist](https://packagist.org/packages/mombol/php-file-queue)[ RSS](/packages/mombol-php-file-queue/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

PHP file queue
==============

[](#php-file-queue)

A php file queue support:

- multi queue task shared one queue data by `queueNamespace`.
- consume queue data by set `consumeSpan`(in order to avoid the queue data file too large).
- track the queue cursor position to recover last cursor position(have to call `track` method manual).

Usage:
------

[](#usage)

### Instance

[](#instance)

```
**NOTE**
* All construct parameters are optional for your custom settings.
* set config `role` to `customer` or orthers when process as a customer to consume queue data which shared by multi queue.

```

File queue instance

```
$FileQueue = new FileQueue(array(
    'silent' => false, // if it is set and is equal to true, just return only one object handler without mount any files
    'role' => 'generator', // queue role, default generator, it must be setted not generator when process as a customer
    'queueNamespace' => 'nsp', // queue namespace to support one queue data shared by multi queue
    'queueDir' => '/var/run/php-file-queue',
    'queueFileName' => 'default',
    'queueFileSuffix' => 'mq',
    'cursorFileSuffix' => 'cursor',
    'initialReadLineNumber' => 0 //  the number of initial read line number, default value set 0 mean that will read from the queue header, the orthers you can set to 'end' which make it read from the queue tail
));

```

File queue data consumption instance

```
$QueueDataConsume = new QueueDataConsume(array(
    'consumeSpan' => 5, // queue consumption span
    'doConsumeBackup' => true, // whether or not to backup the queue consumption data
    'queueDir' => '/var/run/php-file-queue',
    'queueFileName' => 'default'
));

```

### Push data to queue

[](#push-data-to-queue)

```
$data = 'test'; // anything you want to push
$GerneratorFileQueue->push($data);

```

### Pop data from queue

[](#pop-data-from-queue)

```
$num = 1;
$currentPostion = array();
$data = $CustomerFileQueue->pop($num, $currentPostion); // $num : pop number, $currentPostion : current postion after pop a data
// print_r($currentPostion);

```

### Get current position

[](#get-current-position)

```
$pos = $FileQueue->position();

```

### Rewind position to queue header

[](#rewind-position-to-queue-header)

```
$FileQueue->rewind();

```

### Point queue cursor to the end

[](#point-queue-cursor-to-the-end)

```
$FileQueue->end();

```

### Track queue cursor and recover last cursor

[](#track-queue-cursor-and-recover-last-cursor)

```
$FileQueue->track();
$FileQueue->rewind();
// do anything ...
$FileQueue->recover();

```

### Get queue length

[](#get-queue-length)

```
$length = $FileQueue->length();

```

### Tests for the end of file queue

[](#tests-for-the-end-of-file-queue)

```
while (!$FileQueue->eof()) {
    // do anything ...
}

```

### Unmount queue files

[](#unmount-queue-files)

```
$FileQueue->unmount();

```

### Consume queue data

[](#consume-queue-data)

```
$QueueDataConsume->consume();

```

### Clean queue data

[](#clean-queue-data)

```
$QueueDataConsume->clean();

```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity66

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

Total

4

Last Release

3538d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18522472?v=4)[mombol](/maintainers/mombol)[@mombol](https://github.com/mombol)

---

Top Contributors

[![mombol](https://avatars.githubusercontent.com/u/18522472?v=4)](https://github.com/mombol "mombol (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mombol-php-file-queue/health.svg)

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.6M31](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6046.3M531](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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