Skip to content

Repository files navigation

TrueAsync Documentation

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

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

9 languages1500+ pages189 diagrams3 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
usefunctionAsync\{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

SectionDescription
ComponentsCoroutines, Future, Channels, Scope, Pool, TaskGroup, Context
API ReferenceComplete reference for 130+ functions and methods
ArchitectureScheduler, Reactor, Events, Waker, GC, FrankenPHP integration
EvidenceBenchmarks, production cases, academic research
Interactive DemosVisual coroutine timeline, learning map, PDO pool simulator
RFCFormal proposal for PHP internals

Building Locally

# Prerequisites: Node.js 22+
node -v
# Install dependencies
npm install
# Serve locally with hot reload
npm run dev
# Open http://localhost:5173

Tech Stack

  • VitePress — Vue-powered static site generator
  • Vue 3 — custom theme with SFC components
  • Shiki — syntax highlighting with dual light/dark themes
  • MathJax — mathematical formulas (built-in VitePress support)
  • Custom i18n system with 9 languages
  • Dark/light theme with system preference detection

Repository Map

├── .vitepress/
│ ├── config.mts # VitePress configuration
│ └── theme/ # Custom Vue theme
│ ├── Layout.vue # Main layout
│ ├── Navbar.vue # Navigation bar
│ ├── Sidebar.vue # Docs sidebar
│ ├── Footer.vue # Site footer
│ ├── HomePage.vue # Landing page
│ ├── LearningMap.vue # Interactive learning map (SVG)
│ ├── DownloadPage.vue # Downloads page
│ ├── style.css # Global styles + dark theme
│ └── sidebarData*.ts # Sidebar navigation per language
├── en/ ru/ de/ ... # Content per language (9 dirs)
├── vitepress-docs/ # Docs main pages
├── diagrams/{lang}/ # SVG diagrams per language
├── assets/ # Images, logos
└── package.json

Contributing

We welcome contributions in any language! See the Contributing Guide for details.

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

Related Repositories

RepositoryDescription
true-async/php-srcPHP fork with TrueAsync API
true-async/php-asyncExtension implementing the Async API

License

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

About

Documentation for the PHP TrueAsync

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages