An open API service indexing awesome lists of open source software.

https://github.com/true-async/true-async.github.io

Documentation for the PHP TrueAsync
https://github.com/true-async/true-async.github.io

async asynchronous php php8

Last synced: 3 months ago
JSON representation

Documentation for the PHP TrueAsync

Awesome Lists containing this project

README

          

TrueAsync Documentation


Native async/await for PHP — coroutines, structured concurrency, and zero-cost abstractions


English ·
Русский ·
Deutsch ·
Italiano ·
Español ·
Français ·
Українська ·
中文 ·
한국어


9 languages
1500+ pages
189 diagrams
3 interactive demos

---

## What is TrueAsync?

TrueAsync brings **native coroutines** to PHP at the engine level — no userland hacks, no Fibers, no event loop libraries. It's a proposed extension to PHP core that enables:

- **`spawn()` / `await()`** — familiar async primitives, built into the language
- **Structured concurrency** — Scopes, TaskGroups, and automatic cancellation
- **Channels** — safe data exchange between coroutines
- **Connection pooling** — built-in `PDO Pool` with coroutine-aware connection management
- **Zero overhead** — C-level implementation with libuv reactor

```php
use function Async\{spawn, await};

$users = spawn(fn() => $db->query('SELECT * FROM users'));
$orders = spawn(fn() => $db->query('SELECT * FROM orders'));

[$users, $orders] = await($users, $orders); // concurrent execution
```

## Site Structure

| Section | Description |
|---------|-------------|
| **[Components](https://true-async.github.io/en/docs.html)** | Coroutines, Future, Channels, Scope, Pool, TaskGroup, Context |
| **[API Reference](https://true-async.github.io/en/docs/reference/supported-functions.html)** | Complete reference for 130+ functions and methods |
| **[Architecture](https://true-async.github.io/en/architecture.html)** | Scheduler, Reactor, Events, Waker, GC, FrankenPHP integration |
| **[Evidence](https://true-async.github.io/en/docs/evidence/concurrency-efficiency.html)** | Benchmarks, production cases, academic research |
| **[Interactive Demos](https://true-async.github.io/en/interactive/coroutine-demo.html)** | Visual coroutine timeline, learning map, PDO pool simulator |
| **[RFC](https://true-async.github.io/en/rfc.html)** | Formal proposal for PHP internals |

## Building Locally

```bash
# Prerequisites: Ruby, Bundler
gem install bundler

# Install dependencies
bundle install

# Serve locally
bundle exec jekyll serve

# Open http://localhost:4000
```

## Tech Stack

- **[Jekyll](https://jekyllrb.com/)** with GitHub Pages gem
- **[kramdown](https://kramdown.gettalong.org/)** + Rouge for Markdown rendering
- **[KaTeX](https://katex.org/)** for mathematical formulas
- **[PlantUML](https://plantuml.com/)** diagrams pre-rendered to SVG
- Custom i18n system via `_data/i18n/{lang}.yml`

## Repository Map

```
├── ru/ # Russian (original)
├── en/ # English
├── de/ it/ es/ fr/ # German, Italian, Spanish, French
├── uk/ zh/ ko/ # Ukrainian, Chinese, Korean
├── diagrams/{lang}/ # SVG diagrams per language
├── _data/
│ ├── i18n/ # Navigation & UI translations
│ └── pages/ # Page-specific data (home, etc.)
├── _includes/ # Shared HTML partials
├── _layouts/ # Page layouts
├── assets/ # CSS, JS, images
└── css/ # Stylesheets
```

## Contributing

We welcome contributions in any language! See the [Contributing Guide](https://true-async.github.io/en/contributing.html) for details.

- **Translations** — improve or add new languages
- **Content** — fix typos, clarify explanations, add examples
- **Interactive demos** — enhance visualizations

## Related Repositories

| Repository | Description |
|-----------|-------------|
| [true-async/php-src](https://github.com/true-async/php-src) | PHP fork with TrueAsync API |
| [true-async/ext-async](https://github.com/true-async/ext-async) | Extension implementing the Async API |

## License

This documentation is open source. The TrueAsync extension is part of the PHP ecosystem.