PHPackages                             mc0/okq - 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. mc0/okq

ActiveLibrary

mc0/okq
=======

A PHP driver for the okq persistent queue

091PHP

Since Feb 27Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

okq-php
=======

[](#okq-php)

A PHP driver for the [okq](https://github.com/mc0/okq) persistent queue.

okq uses the redis protocol and calling conventions as it's interface, so any standard redis client can be used to interact with it. This package wraps around a normal redis driver, however, to provide a convenient interface to interact with. Specifically, it creates a simple interface for event consumers to use so they retrieve events through a channel rather than implementing that logic manually every time.

Usage
-----

[](#usage)

Commands for okQ are implemented on the `Okq` class parameters resemble those of the okQ command itself. The `Okq` class extends [phpredis/Redis](https://github.com/phpredis/phpredis)and can be constructed using the same arguments:

```
$q = new Okq();
$q->connect('127.0.0.1', 4777);
```

Then to add jobs you just run the command!

```
$event = array('test' => 1);
$eventId = '233'; // this can also be null and will be generated
$success = $q->qlpush('testQueue', json_encode($event), $eventId);
```

If you're a consumer you can just use the convenience `consume` method.

```
/* the $callback can be any callable:
 - array('StaticClass', 'funcName')
 - array($obj, 'funcName')
 - 'funcName'
 - create_function('$event', '...')
*/
$callback = function ($event) use ($q) {
    // do anything or nothing at all
    return Okq::EVENT_ACK;
};
$timeout = 30;
$q->consume($callback, array('testQueue'), $timeout);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e107dc27724c4b361c627a328384104a136f18253ff88bb41981fe0b710dbfb4?d=identicon)[mc0](/maintainers/mc0)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/mc0-okq/health.svg)

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

PHPackages © 2026

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