Zend async Scheduler ABI#22561
Draft
EdmondDantes wants to merge 1 commit into
Draft
Conversation
EdmondDantes
marked this pull request as draft
July 2, 2026 17:48
EdmondDantes
force-pushed
the
async-core
branch
4 times, most recently
from
July 2, 2026 18:11
615d050 to
ed9fe03
Compare
EdmondDantes
force-pushed
the
async-core
branch
10 times, most recently
from
July 3, 2026 09:58
f3b272d to
6e1a5ce
Compare
bwoebi
reviewed
Jul 3, 2026
bwoebi
reviewed
Jul 3, 2026
bwoebi
reviewed
Jul 3, 2026
bwoebi
reviewed
Jul 3, 2026
EdmondDantes
force-pushed
the
async-core
branch
5 times, most recently
from
July 16, 2026 08:21
3286ac0 to
9e95fa1
Compare
EdmondDantes
force-pushed
the
async-core
branch
2 times, most recently
from
July 16, 2026 10:04
4f08e57 to
55fafc8
Compare
EdmondDantes
force-pushed
the
async-core
branch
2 times, most recently
from
July 18, 2026 08:39
88382e3 to
5369211
Compare
…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. Two optional in-tree providers validate the ABI from both sides: ext/test_scheduler, the C reference (gated by test_scheduler.enable), and ext/async_scheduler_hook, the PHP bridge — Async\SchedulerHook + Async\Scheduler (onLaunch/onShutdown/onFiber/onEnqueue/onSuspend/onDefer), a coroutine-centric mandate of three hidden capabilities (bindEntry/switchTo/currentCoroutine), explicit main replacement at every end-of-main handover, and the Async\Context / Async\get_context() surface over the engine storage. Tests run both variants in one binary: upstream suites stay byte-for-byte and run schedulerless; scheduler-adapted duplicates and the provider suites opt in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.