Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d42bc99
#79 Add ZEND_ASYNC_EVENT_F_HIDDEN flag for events excluded from deadl…
EdmondDantes Feb 3, 2026
53ed19d
Add Pool API to zend_async_API for C-level pool creation
EdmondDantes Feb 4, 2026
d498b96
Add PDO connection pooling with async extension integration
EdmondDantes Feb 4, 2026
2401d44
Add PHPT tests for PDO connection pooling
EdmondDantes Feb 4, 2026
819edc8
Redesign PDO pool: per-coroutine dispatch, fix lifecycle and memory l…
EdmondDantes Feb 5, 2026
1e74ffb
Optimize PDO pool factory: borrow template strings instead of copying
EdmondDantes Feb 5, 2026
7769d98
Optimize PDO pool factory: borrow template strings, use async macros
EdmondDantes Feb 5, 2026
927ff9d
Merge remote-tracking branch 'origin/pdo-pool' into pdo-pool
EdmondDantes Feb 5, 2026
d60b5cc
Optimize PDO pool: use async macros, remove redundant checks, lazy wr…
EdmondDantes Feb 5, 2026
786aa83
Optimize PDO pool: use async macros, remove redundant checks, lazy wr…
EdmondDantes Feb 5, 2026
8a018ad
PDO pool: add UNEXPECTED hints, const qualifiers, stable coroutine ha…
EdmondDantes Feb 5, 2026
093ffbc
Merge branch 'true-async' into pdo-pool
EdmondDantes Feb 5, 2026
b89f1cf
PDO pool: fix stmt refcount, lastInsertId/errorInfo safety, MySQL err…
EdmondDantes Feb 5, 2026
27dfa39
PDO pool: fix driver error functions for pool mode across all drivers
EdmondDantes Feb 5, 2026
1481b54
PDO PgSQL: add TrueAsync support for non-blocking query execution
EdmondDantes Feb 6, 2026
e51e609
PDO pool: validate driver pool support via db_handle_init_methods flag
EdmondDantes Feb 6, 2026
1c0c4e7
#79 PDO pool: include pdo_pool.c in extension build and ensure connec…
EdmondDantes Feb 8, 2026
41fa12d
PDO pool: copy credential strings in factory to prevent driver mutati…
EdmondDantes Feb 8, 2026
867b4c9
PDO: fix maybe-uninitialized warning for ctor_args in PDO::prepare
EdmondDantes Feb 8, 2026
28da311
PDO MySQL: add getPool to expected interface methods in test
EdmondDantes Feb 8, 2026
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
79 changes: 79 additions & 0 deletions Zend/zend_async_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,49 @@ static zend_object *new_channel_obj_stub(zend_async_channel_t *channel)
return NULL;
}

static zend_async_pool_t *new_pool_stub(
zend_async_pool_factory_fn factory,
zend_async_pool_destructor_fn destructor,
zend_async_pool_healthcheck_fn healthcheck,
zend_async_pool_before_acquire_fn before_acquire,
zend_async_pool_before_release_fn before_release,
uint32_t min_size,
uint32_t max_size,
uint32_t healthcheck_interval_ms,
size_t extra_size)
{
ASYNC_THROW_ERROR("Async API is not enabled");
return NULL;
}

static zend_object *new_pool_obj_stub(zend_async_pool_t *pool)
{
ASYNC_THROW_ERROR("Async API is not enabled");
return NULL;
}

static bool pool_acquire_stub(zend_async_pool_t *pool, zval *result, zend_long timeout_ms)
{
ASYNC_THROW_ERROR("Async API is not enabled");
return false;
}

static bool pool_try_acquire_stub(zend_async_pool_t *pool, zval *result)
{
ASYNC_THROW_ERROR("Async API is not enabled");
return false;
}

static void pool_release_stub(zend_async_pool_t *pool, zval *resource)
{
ASYNC_THROW_ERROR("Async API is not enabled");
}

static void pool_close_stub(zend_async_pool_t *pool)
{
ASYNC_THROW_ERROR("Async API is not enabled");
}

static bool add_microtask_stub(zend_async_microtask_t *microtask)
{
return true;
Expand Down Expand Up @@ -156,6 +199,14 @@ zend_async_scheduler_launch_t zend_async_scheduler_launch_fn = bool_stub;
/* GROUP API */
zend_async_new_group_t zend_async_new_group_fn = new_group_stub;

/* Pool API */
zend_async_new_pool_t zend_async_new_pool_fn = new_pool_stub;
zend_async_new_pool_obj_t zend_async_new_pool_obj_fn = new_pool_obj_stub;
zend_async_pool_acquire_t zend_async_pool_acquire_fn = pool_acquire_stub;
zend_async_pool_try_acquire_t zend_async_pool_try_acquire_fn = pool_try_acquire_stub;
zend_async_pool_release_t zend_async_pool_release_fn = pool_release_stub;
zend_async_pool_close_t zend_async_pool_close_fn = pool_close_stub;

static zend_atomic_bool reactor_lock = { 0 };
static char *reactor_module_name = NULL;
zend_async_reactor_startup_t zend_async_reactor_startup_fn = NULL;
Expand Down Expand Up @@ -419,6 +470,34 @@ ZEND_API void zend_async_thread_pool_register(
zend_async_queue_task_fn = queue_task_fn;
}

static char *pool_module_name = NULL;

ZEND_API void zend_async_pool_api_register(
char *module, bool allow_override,
zend_async_new_pool_t new_pool_fn,
zend_async_new_pool_obj_t new_pool_obj_fn,
zend_async_pool_acquire_t acquire_fn,
zend_async_pool_try_acquire_t try_acquire_fn,
zend_async_pool_release_t release_fn,
zend_async_pool_close_t close_fn)
{
if (pool_module_name != NULL && false == allow_override) {
zend_error(E_CORE_ERROR,
"The module %s is trying to override Pool API, which was registered by the "
"module %s.",
module, pool_module_name);
return;
}

pool_module_name = module;
zend_async_new_pool_fn = new_pool_fn;
zend_async_new_pool_obj_fn = new_pool_obj_fn;
zend_async_pool_acquire_fn = acquire_fn;
zend_async_pool_try_acquire_fn = try_acquire_fn;
zend_async_pool_release_fn = release_fn;
zend_async_pool_close_fn = close_fn;
}

ZEND_API zend_string *zend_coroutine_gen_info(
zend_coroutine_t *coroutine, char *zend_coroutine_name)
{
Expand Down
Loading
Loading