PHPackages                             ifcastle/amphp-pool - 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. ifcastle/amphp-pool

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

ifcastle/amphp-pool
===================

Middle-level library for creating Stateful Asynchronous server-side applications using the pure PHP and AMPHP

v1.0.2(1y ago)102011MITPHPPHP &gt;=8.3

Since Jul 2Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/IFCastle/amphp-pool)[ Packagist](https://packagist.org/packages/ifcastle/amphp-pool)[ RSS](/packages/ifcastle-amphp-pool/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (16)Versions (6)Used By (1)

AmPHP Pool [![PHP Composer](https://github.com/EdmondDantes/amphp-pool/actions/workflows/php.yml/badge.svg)](https://github.com/EdmondDantes/amphp-pool/actions/workflows/php.yml)
==================================================================================================================================================================================

[](#amphp-pool-)

Middle-level library for creating **Stateful** **Asynchronous** server-side applications using the **pure PHP** and [AMPHP Library](https://github.com/amphp) [![AMPHP](https://avatars.githubusercontent.com/u/8865682?s=50&v=4)](https://avatars.githubusercontent.com/u/8865682?s=50&v=4)

- without *additional extensions* (such as `Swoole`)
- without auxiliary tools from *other* programming languages (such as `Go` + `Roadrunner`)

Why is this needed?
-------------------

[](#why-is-this-needed)

- You want to use only pure PHP without additional extensions.
- You want to control how your Workers operate, and you want to be able to program their behavior to ensure a better balance of performance and stability.

Features
--------

[](#features)

- Workers for handling connections and background tasks (**jobs**), which are restarted and scaled on demand.
- Support for different `types` and `groups` of Workers with varying behaviors.
- Strategies for `restarting`, `scaling`, and `pickuping` Workers for load distribution.
- Execution of **Jobs** based on `priority` and `weight` (*weight being an estimate of resource consumption*).
- `Coroutine Scheduler` for distributing a load among long-running background jobs.
- Support for telemetry and statistics with **Prometheus** + **Grafana**.
- Support for **Windows**.

[![Architecture](docs/images/worker-pool.svg)](docs/images/worker-pool.svg)

But isn't PHP slow?
-------------------

[](#but-isnt-php-slow)

Please review the [performance considerations](docs/01-performance-considerations.md).

Installation
------------

[](#installation)

```
composer require ifcastle/amphp-pool
```

Example
-------

[](#example)

```
