Skip to content

True async api stable #19142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 177 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
fb08bd8
+ ZendAsync API version 1.0.0-dev
EdmondDantes May 24, 2025
e41889d
* add ext/async to gitignore
EdmondDantes May 24, 2025
2978450
+ Add CancellationException class for async API support
EdmondDantes May 24, 2025
2a8d00b
Merge branch 'php:master' into true-async-api
EdmondDantes May 24, 2025
3c7e4c0
% Rename ZendAsync => TrueAsync
EdmondDantes May 25, 2025
f5f6646
Merge remote-tracking branch 'origin/true-async-api' into true-async-api
EdmondDantes May 25, 2025
e799d31
% The method for retrieving exceptions for TrueAsync has been general…
EdmondDantes May 25, 2025
7c0f797
+ Add Context API for coroutine key-value storage
May 25, 2025
a5d445d
+ Implement Context API for coroutine key-value storage
May 25, 2025
ee491e3
Merge branch 'php:master' into true-async-api
EdmondDantes May 25, 2025
c4f9c57
Merge branch 'php:master' into true-async-api
EdmondDantes May 26, 2025
18c94dc
Refactor Context API to use single new_context function
May 26, 2025
a863a07
Merge remote-tracking branch 'origin/true-async-api' into true-async-api
EdmondDantes May 26, 2025
5aee595
Merge branch 'php:master' into true-async-api
EdmondDantes May 26, 2025
9eaad13
Merge branch 'php:master' into true-async-api
EdmondDantes May 27, 2025
b5a7b73
* Fixes in coroutine context implementation.
EdmondDantes May 27, 2025
a937b63
+ config-true-async.yml
EdmondDantes May 27, 2025
d7132fd
+ config-true-async.yml
EdmondDantes May 27, 2025
f915035
+ Enhance coroutine creation and scheduler scope handling
EdmondDantes May 27, 2025
cf52335
* Code related to Scope has been fixed. A main_scope was added, as it…
EdmondDantes May 27, 2025
1b84735
Merge branch 'php:master' into true-async-api
EdmondDantes May 27, 2025
2896aec
+ enqueue_coroutine
EdmondDantes May 28, 2025
29e0cd6
% Refactoring the coroutine context state for switching, so that the …
EdmondDantes May 28, 2025
5059d33
Merge branch 'php:master' into true-async-api
EdmondDantes May 29, 2025
6fa485b
* Unit test await\001-await_basic.phpt
EdmondDantes May 29, 2025
f4597e1
* fix bug with waker dtor
EdmondDantes May 29, 2025
4cff86f
% Refactoring the extension mechanism for Event-type objects.
EdmondDantes May 29, 2025
9537c42
% Added code to catch exceptions in the main coroutine. The exception…
EdmondDantes May 30, 2025
152c877
* Fixed bugs in the Timeout class.
EdmondDantes May 30, 2025
95b12f7
* fix zend_async_waker_callback_resolve. The method now automatically…
EdmondDantes May 30, 2025
3fce53c
* fix Unix build process
EdmondDantes May 31, 2025
f471995
fix: ensure extended_data is set only in coroutine context
EdmondDantes May 31, 2025
372d6d7
Merge remote-tracking branch 'origin/true-async-api' into true-async-api
EdmondDantes May 31, 2025
daac306
* fix GC error fornon TLS
EdmondDantes Jun 1, 2025
7e9e31a
* Fixed correct handling of multiple SAPI initializations for PHPDBG.
EdmondDantes Jun 1, 2025
ca3e57c
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jun 1, 2025
0a92de9
+ Add 'True Async API' out for configure Win32
EdmondDantes Jun 1, 2025
967bdb5
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 1, 2025
a7281f9
* fix for #define ZEND_ASYNC_GETADDRINFO(node, service, hints) zend_a…
EdmondDantes Jun 4, 2025
0d981ee
* fix for #define ZEND_ASYNC_GETADDRINFO(node, service, hints) zend_a…
EdmondDantes Jun 4, 2025
9011197
Add nanosecond support to async timer events with backward compatibility
EdmondDantes Jun 4, 2025
8333867
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 4, 2025
3e21d38
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 5, 2025
cd3ac1b
+ add ZEND_ASYNC_GETADDRINFO_EX
EdmondDantes Jun 5, 2025
aac97d7
+ TrueAsync API docs
EdmondDantes Jun 5, 2025
00a2768
+ TrueAsync API docs
EdmondDantes Jun 5, 2025
bd31f8e
% Refactoring Zend DNS API
EdmondDantes Jun 5, 2025
305cef7
+ ZEND_ASYNC_GET_COROUTINE_CONTEXT
EdmondDantes Jun 5, 2025
19dc561
+ Coroutine Internal context
EdmondDantes Jun 5, 2025
83452b8
% refactoring Internal Context API
EdmondDantes Jun 5, 2025
60567ff
% refactoring Internal Context API
EdmondDantes Jun 6, 2025
98ab2e6
% refactoring ZEND_ASYNC_INTERNAL_CONTEXT_FIND
EdmondDantes Jun 6, 2025
aaaafe6
+ zend_async_event_callback API
EdmondDantes Jun 6, 2025
0381a5c
fix: Fixed a bug related to event deletion.
EdmondDantes Jun 7, 2025
7970eaa
Fix concurrent modification bug in zend_async_callbacks_notify
EdmondDantes Jun 7, 2025
43d48eb
* fix bugs with callbacks vector iterator
EdmondDantes Jun 7, 2025
2fcd971
% move vector functions to *.c
EdmondDantes Jun 7, 2025
d4d0d8b
* fix bugs with events callbacks vector
EdmondDantes Jun 7, 2025
9eb5688
* fix waker_events_dtor
EdmondDantes Jun 7, 2025
a234daa
* fix for waker_events_dtor
EdmondDantes Jun 7, 2025
e08a5b5
* fix coroutine_event_callback_dispose issue double free
EdmondDantes Jun 7, 2025
63d43e5
% Event references have been added — a mechanism that allows separati…
EdmondDantes Jun 8, 2025
2168102
% refactoring zend_async_callbacks_notify
EdmondDantes Jun 8, 2025
5991d08
+ update docs
EdmondDantes Jun 8, 2025
2fbd940
+ A special method event.replay has been added, which can be used for…
EdmondDantes Jun 9, 2025
cb8debd
% refactoring zend_async_coroutine_callback_new
EdmondDantes Jun 10, 2025
899448e
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 10, 2025
01d3fdc
+ ZEND_ASYNC_EVENT_CALLBACK macrofunction
EdmondDantes Jun 10, 2025
0e78bf0
Merge remote-tracking branch 'origin/true-async-api' into true-async-api
EdmondDantes Jun 10, 2025
530174d
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 10, 2025
e0c64f1
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 12, 2025
a71012b
+ auto stop event for zend_async_callbacks_notify_and_close
EdmondDantes Jun 12, 2025
a8c2d42
+ Socket Listening API
EdmondDantes Jun 13, 2025
fc174c1
Add global main coroutine switch handlers API for context isolation
EdmondDantes Jun 14, 2025
5aca1a9
% optimize coroutine switch hook
EdmondDantes Jun 15, 2025
bd0699d
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 15, 2025
089cfe5
* fix behavior with dispose operation inside zend_async_callbacks_notify
EdmondDantes Jun 15, 2025
7e146ad
Merge remote-tracking branch 'origin/true-async-api' into true-async-api
EdmondDantes Jun 15, 2025
fa0ccab
* UNIX: fix exec tests
EdmondDantes Jun 20, 2025
cbe111c
* UNIX: Refactoring of coroutine cancellation and completion logic
EdmondDantes Jun 20, 2025
8ee66aa
+ ZEND_ASYNC_WAKER_APPLY_ERROR
EdmondDantes Jun 20, 2025
a0ed682
+ Refactoring async_coroutine_cancel
EdmondDantes Jun 20, 2025
def82b4
* fix ZEND_ASYNC_INITIALIZE issue
EdmondDantes Jun 21, 2025
085e265
* fix ZEND_ASYNC_IS_OFF issue
EdmondDantes Jun 21, 2025
09e6031
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 21, 2025
7b665ed
+ Scope API
EdmondDantes Jun 23, 2025
9990aa8
% refactoring catch_or_cancel logic according to RFC scope behavior
EdmondDantes Jun 24, 2025
739364f
* fix build issue for Scope
EdmondDantes Jun 24, 2025
209bd32
* fixes scope_try_to_dispose
EdmondDantes Jun 24, 2025
a234299
% The ZEND_ASYNC_NEW_SCOPE API function has been modified — it can no…
EdmondDantes Jun 24, 2025
964eca0
add coroutine priority support to TrueAsync API
EdmondDantes Jun 25, 2025
09947a1
Add cross-thread trigger event API
EdmondDantes Jun 25, 2025
f195fe6
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 25, 2025
2137eb5
+ **Iterator API integration**: Added `zend_async_iterator_t` structu…
EdmondDantes Jun 25, 2025
2593f66
% refactoring typedef zend_async_iterator_t* (*zend_async_new_iterato…
EdmondDantes Jun 26, 2025
de45e8c
+ async_spawn_and_throw
EdmondDantes Jun 26, 2025
9301b6c
% Major refactoring of Finally Handlers and the exception handling me…
EdmondDantes Jun 27, 2025
ce5c1d7
% prepare code for zend_call_destructors
EdmondDantes Jun 27, 2025
1f109f6
+ shutdown_destructors_async Support for concurrent iteration of the …
EdmondDantes Jun 28, 2025
31999c5
+ shutdown_destructors_async Support for concurrent iteration of the …
EdmondDantes Jun 28, 2025
36ab8a9
+ shutdown_destructors_async Support for concurrent iteration of the …
EdmondDantes Jun 28, 2025
818cd16
* fix issue with structure initialization
EdmondDantes Jun 29, 2025
a8782ec
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 29, 2025
1fa4663
* Change --enable-experimental-async-api to --disable-async-api.
EdmondDantes Jun 30, 2025
8f15592
Merge branch 'php:master' into true-async-api
EdmondDantes Jun 30, 2025
e8fb89d
* fix bug with PHP_ASYNC_API
EdmondDantes Jun 30, 2025
e054b53
% change Trye Async API version to 0.2
EdmondDantes Jun 30, 2025
2f99cee
* fix issue with API stub
EdmondDantes Jun 30, 2025
e27f9b6
Merge remote-tracking branch 'origin/true-async-api' into true-async-api
EdmondDantes Jun 30, 2025
daba869
Merge branch 'php:master' into true-async-api-stable
EdmondDantes Jun 30, 2025
f99433c
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jun 30, 2025
7945990
fix: add explicit pointer casts for C++ compatibility in async API
EdmondDantes Jun 30, 2025
8fca959
* Fixed an issue with incorrect cleanup of coroutine interceptor hand…
EdmondDantes Jul 1, 2025
9645e1e
#6: * Fixed GC behavior in the context of coroutines. Infinite garbag…
EdmondDantes Jul 2, 2025
b675f11
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jul 2, 2025
9f3bd23
#7: Refactoring of Zend GC logic for coroutines. Added GC context for…
EdmondDantes Jul 3, 2025
6e955d2
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jul 3, 2025
5802ace
#7: Fixed a bug with incorrect memory release of a microtask.
EdmondDantes Jul 3, 2025
c768c1f
#7: zend_hrtime_t dtor_start_time Fixed a variable initialization sta…
EdmondDantes Jul 3, 2025
3a89d8f
#19: Memory leaks fixed for GC and coroutine tests.
EdmondDantes Jul 3, 2025
5fdaf59
#19: Changes in the Zend Async API shutdown mechanism
EdmondDantes Jul 4, 2025
ac1f0eb
#19: * The ref_count logic for event callbacks has been improved. Spe…
EdmondDantes Jul 4, 2025
9d59043
#8: Add comprehensive bailout tests for TrueAsync API
EdmondDantes Jul 5, 2025
28530c8
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jul 5, 2025
f8c81f6
#9: * Fixes in the zend_iterator logic in the context of concurrent i…
EdmondDantes Jul 5, 2025
ef9a619
#9: * Fix event callback disposal and improve error handling in TrueA…
EdmondDantes Jul 6, 2025
fe7b894
#9: + Added functionality for proper handling of exceptions from `Zen…
EdmondDantes Jul 7, 2025
70d3b0c
#9: fix issue with static void coroutine_event_callback_dispose
EdmondDantes Jul 7, 2025
72786c3
#9: + add ZEND_ASYNC_SCOPE_SET_DISPOSED
EdmondDantes Jul 9, 2025
bd76291
#9: + ZEND_ASYNC_SCOPE_CLR_DISPOSING
EdmondDantes Jul 9, 2025
35d4849
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jul 10, 2025
9f57f11
#25: * fix Zend GC issue with Fiber case
EdmondDantes Jul 10, 2025
1a398f9
#25: * fix Zend GC issue after refactoring
EdmondDantes Jul 11, 2025
2920783
#25: * fix warning for end var
EdmondDantes Jul 11, 2025
6b98adb
#23: + edge cases for fiber from spawn and spawn from fiber
EdmondDantes Jul 11, 2025
077b2c6
Merge branch 'true-async-api' into true-async-api-stable
EdmondDantes Jul 12, 2025
d17f623
Add zend_future_t structure to async API
EdmondDantes Jul 12, 2025
e1e7d6c
Add zend_async_channel_t abstract structure to async API
EdmondDantes Jul 12, 2025
94227f5
#13: Initial classes for Future
EdmondDantes Jul 12, 2025
518b411
#13: Future methods
EdmondDantes Jul 12, 2025
bbed9c9
#31: * Fixed a memory leak when zend_async_resume_when fails.
EdmondDantes Jul 14, 2025
e5e9b2a
#31: + Added support for waiting on identical objects, even if they h…
EdmondDantes Jul 14, 2025
9779f45
#31: + Fix MSVC C4200 warning: replace flexible array with MSVC-comp…
EdmondDantes Jul 14, 2025
5822582
#32: + Cannot resume when there is an active exception in the engine.
EdmondDantes Jul 14, 2025
d5b7a74
Merge branch 'php:master' into true-async-api
EdmondDantes Jul 15, 2025
d3a5996
* remove CI pipe
EdmondDantes Jul 15, 2025
67acaf0
Merge branch 'true-async-api-stable' into true-async-api
EdmondDantes Jul 15, 2025
5f95318
Merge branch 'php:master' into true-async-api
EdmondDantes Jul 15, 2025
6cebd7d
% update docs
EdmondDantes Jul 16, 2025
8f4778f
* fix GC end var warning
EdmondDantes Jul 16, 2025
ebfecef
+ APIs for channels and futures have been added. The API for working …
EdmondDantes Jul 16, 2025
aadca21
% refactoring zend_async_resume_when with zend_exception_save/restore
EdmondDantes Jul 16, 2025
f7825de
* fix DOCS
EdmondDantes Jul 16, 2025
a2f97ca
+ Apply Clang format
EdmondDantes Jul 16, 2025
805aa06
Merge branch 'php:master' into true-async-api
EdmondDantes Jul 16, 2025
eefe881
* fix This should be removed
EdmondDantes Jul 16, 2025
3fc842a
* remove doc
EdmondDantes Jul 16, 2025
e32de6b
+ true async doc
EdmondDantes Jul 16, 2025
fdd756a
* rename dtor functions
EdmondDantes Jul 16, 2025
ef88e64
% Code refactoring according to the PR.
EdmondDantes Jul 16, 2025
26f280a
Merge branch 'true-async-api-doc' into true-async-api
EdmondDantes Jul 17, 2025
7b5ce94
% remove PHP_ASYNC_API ifdef
EdmondDantes Jul 17, 2025
48f9e03
% remove PHP_ASYNC_API ifdef
EdmondDantes Jul 17, 2025
d0c6551
Merge branch 'php:master' into true-async-api
EdmondDantes Jul 17, 2025
dfc0d12
* fix docs
EdmondDantes Jul 17, 2025
1aead24
% remove PHP_ASYNC_API
EdmondDantes Jul 17, 2025
a32b9c7
% remove zval_call_destructor
EdmondDantes Jul 17, 2025
e6b3181
* fix memleack gc
EdmondDantes Jul 17, 2025
03e32c5
% update email
EdmondDantes Jul 17, 2025
4310a08
* fix error: ‘end’ may be used uninitialized
EdmondDantes Jul 17, 2025
9486c42
+ zend_async_init_internal_context_api early initialization of the as…
EdmondDantes Jul 19, 2025
852e811
Merge branch 'php:master' into true-async-api
EdmondDantes Jul 19, 2025
460e4fa
* fix zend_async_event_callback_new
EdmondDantes Jul 20, 2025
50b16fc
* fix zend_async_coroutine_callback_new
EdmondDantes Jul 20, 2025
f7b02c3
* fix zend_async_coroutine_callback_new warning
EdmondDantes Jul 20, 2025
20991b1
% remove CANCELLATION exception from PHPCore
EdmondDantes Jul 20, 2025
3f050e9
Merge branch 'php:master' into true-async-api
EdmondDantes Jul 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "Optimizer/zend_optimizer.h"
#include "php.h"
#include "php_globals.h"
#include "zend_async_API.h"

// FIXME: Breaks the declaration of the function below
#undef zenderror
Expand Down Expand Up @@ -1349,6 +1350,10 @@ ZEND_API void zend_deactivate(void) /* {{{ */
/* shutdown_executor() takes care of its own bailout handling */
shutdown_executor();

// The execution of the True Async API should end here,
// after the GC has been run.
ZEND_ASYNC_ENGINE_SHUTDOWN();

zend_try {
zend_ini_deactivate();
} zend_end_try();
Expand Down Expand Up @@ -1946,7 +1951,11 @@ ZEND_API zend_result zend_execute_script(int type, zval *retval, zend_file_handl
if (Z_TYPE(EG(user_exception_handler)) != IS_UNDEF) {
zend_user_exception_handler();
}
if (EG(exception)) {

// If we are inside a coroutine,
// we do not call the final error handler,
// as the exception will be handled higher up in the method ZEND_ASYNC_RUN_SCHEDULER_AFTER_MAIN
if (false == ZEND_ASYNC_CURRENT_COROUTINE && EG(exception)) {
ret = zend_exception_error(EG(exception), E_ERROR);
}
}
Expand Down
Loading