PHPackages                             cloverphp/async - 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. cloverphp/async

ActiveLibrary

cloverphp/async
===============

async

v0.0.1(7mo ago)1239↓100%1MITPHPPHP ^8.2

Since Sep 29Pushed 7mo agoCompare

[ Source](https://github.com/cloverphp/clover-async)[ Packagist](https://packagist.org/packages/cloverphp/async)[ RSS](/packages/cloverphp-async/feed)WikiDiscussions main Synced 1mo ago

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

Clover Async
------------

[](#clover-async)

[![Code Coverage](https://github.com/cloverphp/clover/actions/workflows/code-coverage.yml/badge.svg?branch=main)](https://github.com/cloverphp/clover/actions/workflows/code-coverage.yml)[![Tests](https://github.com/cloverphp/clover/actions/workflows/tests.yml/badge.svg)](https://github.com/cloverphp/clover/actions/workflows/tests.yml)[![Packagist Version](https://camo.githubusercontent.com/a98b6e87b8cd7a2ea17d3ecf640f96f738db20e9ec9f5432b068319adaf54372/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c6f7665727068702f6173796e633f7374796c653d666c6174266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d253233666666)](https://camo.githubusercontent.com/a98b6e87b8cd7a2ea17d3ecf640f96f738db20e9ec9f5432b068319adaf54372/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c6f7665727068702f6173796e633f7374796c653d666c6174266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d253233666666)[![Packagist Dependency Version](https://camo.githubusercontent.com/6c223079ac05537cbbd3f1753b5a9d44e96cddf396792262902ccfab2cba798d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f636c6f7665727068702f6173796e632f7068703f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d626c7565266c6162656c3d50485026636f6c6f723d626c7565)](https://camo.githubusercontent.com/6c223079ac05537cbbd3f1753b5a9d44e96cddf396792262902ccfab2cba798d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f636c6f7665727068702f6173796e632f7068703f7374796c653d666c6174266c6f676f3d706870266c6f676f436f6c6f723d626c7565266c6162656c3d50485026636f6c6f723d626c7565)[![Packagist License](https://camo.githubusercontent.com/9569e38e541862a4a5f75e59a6d4abebf43e35939b1e10c81ef76d616079a1ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636c6f7665727068702f6173796e633f7374796c653d666c6174266c6162656c3d4c6963656e736526636f6c6f723d626c7565)](https://camo.githubusercontent.com/9569e38e541862a4a5f75e59a6d4abebf43e35939b1e10c81ef76d616079a1ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636c6f7665727068702f6173796e633f7374796c653d666c6174266c6162656c3d4c6963656e736526636f6c6f723d626c7565)[![Packagist Downloads](https://camo.githubusercontent.com/7f0e94f8e9bfafdbc2b4430e632c891c4e106531fc5c451fbfa6c89c48151a54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c6f7665727068702f6173796e633f7374796c653d666c6174266c6f676f3d7061636b6167697374266c6162656c3d446f776e6c6f61647326636f6c6f723d626c7565)](https://camo.githubusercontent.com/7f0e94f8e9bfafdbc2b4430e632c891c4e106531fc5c451fbfa6c89c48151a54/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c6f7665727068702f6173796e633f7374796c653d666c6174266c6f676f3d7061636b6167697374266c6162656c3d446f776e6c6f61647326636f6c6f723d626c7565)

---

### Example 1

[](#example-1)

Time based async task

```
use Clover\Utils\Timer;
use Clover\Utils\LoggerTrait;
use function Clover\Async\async;

class Demo {
    use LoggerTrait;

    public function run(): void {
        $this->log("Starting demo...");

        Timer::setTimeout(fn() => $this->log("Timeout fired after 1s"), 1000);

        $cancel = Timer::setInterval(fn() => $this->log("Interval tick every 500ms"), 500);

        // cancel interval after 3 seconds
        Timer::setTimeout(fn() => $cancel(), 3000);
    }
}

$demo = new Demo();
$demo->run();
```

---

### Example 2

[](#example-2)

Promise based HTTP calling.

```
use Clover\Http\HttpClient;
use function Clover\Async\{async, await};

$client = new HttpClient();

$router->get('/users', async(function ($req, $res) use ($client) {
    try {
        $response = await($client->fetch("https://jsonplaceholder.typicode.com/users/1"));
        $res->json($response->json());
    } catch (\Throwable $e) {
        $res->status(500)->send("Error: " . $e->getMessage());
    } finally {
        log("Route /users finished");
    }
}));
```

---

### Example 3

[](#example-3)

Async/Await Promise

```
use function Clover\Async\{async, await};
use Clover\Async\Http\HttpClient;

$client = new HttpClient();

$router->get('/users', async(function ($req, $res) use ($client) {
    try {
        $json = await($client->fetch("https://jsonplaceholder.typicode.com/users/1"));
        $res->json(json_decode($json, true));
    } catch (\Throwable $e) {
        $res->status(500)->send("Error: " . $e->getMessage());
    } finally {
        log("Route /users finished");
    }
}));
```

---

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance64

Regular maintenance activity

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14ee8bc204856d2c784a628778d5ae25e5ef14052cce198ca3a7943574832260?d=identicon)[CodeWithSushil](/maintainers/CodeWithSushil)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cloverphp-async/health.svg)

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

PHPackages © 2026

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