PHPackages                             krakjoe/promises - 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. krakjoe/promises

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

krakjoe/promises
================

Promises in PHP using pthreads v1.0.0+

v1.0.3(11y ago)65695PHPPHP

Since Mar 8Pushed 10y ago6 watchersCompare

[ Source](https://github.com/krakjoe/promises)[ Packagist](https://packagist.org/packages/krakjoe/promises)[ Docs](http://pthreads.org/)[ RSS](/packages/krakjoe-promises/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (6)Used By (0)

promises
========

[](#promises)

Promises in PHP using **pthreads v1.0.0+**

Promise Manager
===============

[](#promise-manager)

The Promise Manager represents a pool of threads used to fulfill promises in parallel.

The only public API for the `PromiseManager` is the constructor:

```
public PromiseManager::__construct($size = 4, $worker = \Worker::class, $ctor = [])

```

See `Pool::__construct` in the PHP manual.

Promise
=======

[](#promise)

A `Promise` represents a promise to execute the public interface of a `Promisable` at some time in the future:

```
public Promise::__construct(PromiseManager $manager, Promisable $promisable)

```

A `Promise` provides the ability to schedule the subsequent execution of the public interface of a `Thenable`.

```
public Promise Promise::then(Thenable $then)

```

Interfaces
==========

[](#interfaces)

IPromisable

```
public void IPromisable::onFulfill();

```

IThenable

```
public void IThenable::onFulfilled(Promisable $promised);
public void IThenable::onError(Promisable $promised);

```

Notes
=====

[](#notes)

Exceptions thrown by `Promisable`, or `Thenable` objects will be caught and bubble up to invoke subsequent `Thenable::onError`.

```
$manager = new PromiseManager();
$promise =
	new Promise($manager, new CalculateTheMeaningOfLife());
$promise
	->then(
		new AddTwo($promise))
	->then(
		new PrintMeaning($promise));

$manager->shutdown();
```

This is a work in progress
--------------------------

[](#this-is-a-work-in-progress)

Note that, this is a work in progress, that does not aim for maximum compatibility with any established standard but rather an easy to use implementation, that is compatible with and takes full advantage of pthreads.

While reading the API, remember everything you read other than `PromiseManager` is a *pthreads* object

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 92.5% 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 ~91 days

Total

4

Last Release

4267d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2236138?v=4)[Joe Watkins](/maintainers/krakjoe)[@krakjoe](https://github.com/krakjoe)

---

Top Contributors

[![krakjoe](https://avatars.githubusercontent.com/u/2236138?v=4)](https://github.com/krakjoe "krakjoe (37 commits)")[![Danack](https://avatars.githubusercontent.com/u/1505719?v=4)](https://github.com/Danack "Danack (1 commits)")[![draco2003](https://avatars.githubusercontent.com/u/196891?v=4)](https://github.com/draco2003 "draco2003 (1 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (1 commits)")

---

Tags

promisespthreads

### Embed Badge

![Health badge](/badges/krakjoe-promises/health.svg)

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

###  Alternatives

[react/promise

A lightweight implementation of CommonJS Promises/A for PHP

2.5k397.0M680](/packages/react-promise)[internal/promise

A lightweight implementation of CommonJS Promises/A for PHP

541.5M3](/packages/internal-promise)[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)
