PHPackages                             marko/amphp - 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. [Framework](/categories/framework)
4. /
5. marko/amphp

ActiveMarko-module[Framework](/categories/framework)

marko/amphp
===========

Revolt event loop lifecycle and config integration for Marko Framework

0.7.0(4w ago)052↓90%MITPHPPHP ^8.5

Since Mar 25Pushed 4w agoCompare

[ Source](https://github.com/marko-php/marko-amphp)[ Packagist](https://packagist.org/packages/marko/amphp)[ RSS](/packages/marko-amphp/feed)WikiDiscussions develop Synced 3w ago

READMEChangelogDependencies (18)Versions (18)Used By (0)

marko/amphp
===========

[](#markoamphp)

Async event loop foundation for Marko -- runs the Revolt event loop and provides the `pubsub:listen` command for long-lived subscriber processes.

Overview
--------

[](#overview)

`marko/amphp` integrates the [amphp/amp](https://amphp.org/) async runtime into the Marko framework. It wraps the Revolt event loop in an `EventLoopRunner` that can be started and stopped cleanly, and registers the `pubsub:listen` console command for running long-lived subscriber processes.

Driver packages that require the async event loop install this package automatically.

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

[](#installation)

```
composer require marko/amphp
```

Usage
-----

[](#usage)

### Running the event loop

[](#running-the-event-loop)

```
use Marko\Amphp\EventLoopRunner;
use Revolt\EventLoop;

// Schedule async work, then run the loop
EventLoop::defer(function (): void {
    // ... async work ...
});

$runner = new EventLoopRunner();
$runner->run(); // blocks until the loop exits
```

### Starting the pub/sub listener

[](#starting-the-pubsub-listener)

Use the built-in console command to start a long-lived subscriber process:

```
php marko pubsub:listen
```

The command blocks until stopped with `Ctrl+C`, running all registered Revolt callbacks and pub/sub subscribers.

### Stopping the loop programmatically

[](#stopping-the-loop-programmatically)

```
$runner->stop();       // stops the loop if running
$runner->isRunning();  // returns bool
```

API Reference
-------------

[](#api-reference)

### `EventLoopRunner`

[](#eventlooprunner)

Wraps `Revolt\EventLoop` for lifecycle management.

MethodReturnDescription`run()``void`Starts the event loop; blocks until the loop exits.`stop()``void`Stops the event loop if it is currently running.`isRunning()``bool`Returns whether the event loop is active.### `AmphpConfig`

[](#amphpconfig)

Reads amphp-related configuration values.

MethodReturnDescription`shutdownTimeout()``int`Returns `amphp.shutdown_timeout` from config (milliseconds).### `PubSubListenCommand`

[](#pubsublistencommand)

Console command (`pubsub:listen`) that starts the event loop runner and keeps the process alive for pub/sub subscribers.

Documentation
-------------

[](#documentation)

Full usage, API reference, and examples: [marko/amphp](https://marko.build/docs/packages/amphp/)

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Every ~4 days

Recently: every ~16 days

Total

16

Last Release

28d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

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

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/marko-amphp/health.svg)

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

###  Alternatives

[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k885.1k22](/packages/danog-madelineproto)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)

PHPackages © 2026

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