PHPackages                             limen/fastrq - 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. [Caching](/categories/caching)
4. /
5. limen/fastrq

ActiveLibrary[Caching](/categories/caching)

limen/fastrq
============

Queue, Stack, Deque, Priority Queue built on Redis

v0.1.0(7y ago)536MITPHPPHP &gt;=5.5

Since Jan 16Pushed 7y ago2 watchersCompare

[ Source](https://github.com/limen/fastrq-php)[ Packagist](https://packagist.org/packages/limen/fastrq)[ Docs](https://github.com/limen/fastrq-php)[ RSS](/packages/limen-fastrq/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Fastrq - Queue, Stack and Priority Queue based on Redis
=======================================================

[](#fastrq---queue-stack-and-priority-queue-based-on-redis)

[![Build Status](https://camo.githubusercontent.com/913bb602d7921c3dff35a2cf1c6b1d0ddf0ef1d9fb204d6691308af6184a81cf/68747470733a2f2f7472617669732d63692e6f72672f6c696d656e2f6661737472712d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/limen/fastrq-php)

[Wiki](https://github.com/limen/fastrq/wiki)

[Fastrq for Python](https://github.com/limen/fastrq)

Features
--------

[](#features)

- Abstract Queue, Deque, Capped Queue/Deque, and Overflow-able Capped Queue/Deque
- Abstract Stack, Capped Stack
- Abstract Priority Queue, Capped Priority Queue and Overflow-able Capped Priority Queue
- Push and Pop support batch operation
- Using Lua scripts to save RTT (Round Trip Time)

more in [Wiki](https://github.com/limen/fastrq/wiki)

install
-------

[](#install)

Recommend to install via composer

```
composer require limen/fastrq

```

Usage
-----

[](#usage)

```
use Limen\Fastrq\Queue;
use Limen\Fastrq\Deque;
use Limen\Fastrq\Stack;
use Limen\Fastrq\PriorityQueue;

// queue
$q = new Queue('fastrq-queue');
$q->push(['hello', 'world']);
$q->push('!!');
$q->pop();
$q->pop(2);
$q->pushNI('hello');
$q->pushAE('from');
$q->pushNE(['from', 'fastrq']);

// deque
$dq = new Deque('fastrq-deque');
$dq->pushFront(['hello', 'world']);
$dq->pushBack('!!');
$dq->popFront();
$dq->popBack(2);
$dq->pushFrontNI('hello');
$dq->pushBackNI('hello');
$dq->pushFrontNE('from');
$dq->pushBackNE(['from', 'fastrq']);
$dq->pushFrontAE('from');
$dq->pushBackAE(['from', 'fastrq']);

// stack
$s = new Stack('fastrq-stack');
$s->push(['hello', 'world']);
$s->push('!!');
$s->pop();
$s->pop(2);
$s->pushNI('hello');
$s->pushAE('from');
$s->pushNE(['from', 'fastrq']);

// priority queue
$pq = new PriorityQueue('fastrq-priority-queue');
$pq->push(['hello' => 1]);
$pq->push(['hello' => 1, 'world' => 2]);
$pq->pushNI('fastrq', 2);
$pq->pushAE(['hello' => 1, 'world' => 2]);
$pq->pushNE(['hello' => 1, 'world' => 2]);
```

Data types
----------

[](#data-types)

### Queue

[](#queue)

- first in and first out
- unlimited capacity
- support batch push and batch pop

### Deque

[](#deque)

Derive from queue with more features

- support push front and push back
- support pop front and pop back

### Capped Queue/Deque

[](#capped-queuedeque)

Derive from queue/deque with more features

- Have fixed capacity
- Push to a full one would fail
- Push to one whose positions are not enough would fail

### Overflow-able Capped Queue/Deque

[](#overflow-able-capped-queuedeque)

Derive from capped queue/deque with more features

- The queue length would never exceed its capacity
- Push to an end would push out from the other end if one is full

### Stack

[](#stack)

- Last in and First out
- Unlimited capacity
- Support batch push and batch pop

### Capped Stack

[](#capped-stack)

Derive from Stack with more features

- Have fixed capacity
- Push to a full capped stack would fail
- Push to a capped stack whose positions are not enough would fail

### Priority Queue

[](#priority-queue)

- The lower the score, the higher the priority
- Unlimited capacity
- Support batch push and batch pop

### Capped Priority Queue

[](#capped-priority-queue)

Derive from Priority Queue with more features

- Have fixed capacity
- Push to a full one would fail
- Push to a capped one whose positions are not enough would fail

### Overflow-able Capped Priority Queue

[](#overflow-able-capped-priority-queue)

Derive from Capped Priority Queue with more features

- The queue length would never exceed its capacity
- Push to an end would push out from the other end if queue is full

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

2674d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49d0b6c3647be78ab9b2703cd07c681a8098a0815f2ac676da4e3eafd2c08474?d=identicon)[limen](/maintainers/limen)

---

Top Contributors

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

---

Tags

luaphpqueueredisstackredisqueuestack

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/limen-fastrq/health.svg)

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

###  Alternatives

[mjphaynes/php-resque

Redis backed library for creating background jobs and processing them later.

228199.3k2](/packages/mjphaynes-php-resque)[pdffiller/qless-php

PHP Bindings for qless

29113.2k1](/packages/pdffiller-qless-php)[spinx/sidekiq-job-php

Push and schedule jobs to Sidekiq from PHP

37219.6k](/packages/spinx-sidekiq-job-php)[kevindees/laravel-redis-queue

Redis queue managment for laravel.

1634.1k](/packages/kevindees-laravel-redis-queue)

PHPackages © 2026

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