Skip to content

Zend async Scheduler ABI#22561

Open
EdmondDantes wants to merge 1 commit into
php:masterfrom
true-async:async-core
Open

Zend async Scheduler ABI#22561
EdmondDantes wants to merge 1 commit into
php:masterfrom
true-async:async-core

Conversation

@EdmondDantes

@EdmondDantes EdmondDantes commented Jul 2, 2026

Copy link
Copy Markdown

A lightweight asynchronous core without complex logic.

The idea is:
https://github.com/true-async/php-async-core-rfc/blob/main/scheduler_rfc.md

A detailed explanation of the core integration can be found here:
https://github.com/true-async/php-async-core-rfc/blob/main/core-integration.md

At the moment, both the code and the RFC are still under development. I'd be happy to hear your ideas and feedback.

@EdmondDantes
EdmondDantes marked this pull request as draft July 2, 2026 17:48
@EdmondDantes
EdmondDantes force-pushed the async-core branch 4 times, most recently from 615d050 to ed9fe03 Compare July 2, 2026 18:11
@EdmondDantes
EdmondDantes force-pushed the async-core branch 10 times, most recently from f3b272d to 6e1a5ce Compare July 3, 2026 09:58
Comment thread Zend/zend_async_API.c Outdated
Comment thread Zend/zend_scheduler_hook.stub.php Outdated
Comment thread Zend/zend_gc.c Outdated
Comment thread Zend/zend_scheduler_hook.stub.php Outdated
@EdmondDantes
EdmondDantes force-pushed the async-core branch 2 times, most recently from 4f08e57 to 55fafc8 Compare July 16, 2026 10:04
@EdmondDantes EdmondDantes changed the title Async core Zend async Scheduler ABI Jul 16, 2026
@EdmondDantes
EdmondDantes force-pushed the async-core branch 7 times, most recently from 93eb5a4 to 19c3a58 Compare July 23, 2026 05:01
…ne context

The Async Core ABI (zend_async_API.h): coroutines with a packed lifecycle,
scheduler slots (launch, enqueue-with-error, suspend, cancel, await),
switch/finish handler vectors, the awaiting-info vector, microtasks, and
the coroutine context — an embedded internal store for C extensions
(process-unique numeric keys) plus the userland zend_async_context_t
storage behind a provider-registered class. Fibers run as coroutines under
a scheduler; gc_collect_cycles() stays synchronous over a GC coroutine;
shutdown drains coroutines gracefully; exit() in a fiber raises the
shutdown notification.

ext/test_scheduler validates the ABI in-tree: the C reference provider,
gated by test_scheduler.enable. The PHP registration bridge lives out of
tree (ext-scheduler-hook) and talks to the core through ZEND_API only.

Upstream suites stay byte-for-byte and run schedulerless; the
scheduler-adapted duplicates and the provider suite opt in.
@EdmondDantes
EdmondDantes force-pushed the async-core branch 2 times, most recently from 19c3a58 to 8f34764 Compare July 23, 2026 08:45
@EdmondDantes
EdmondDantes marked this pull request as ready for review July 23, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants