Skip to content

#39: Add stubs for TrueAsync API 0.5.0 #40

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

Merged
merged 1 commit into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Docker support with multi-stage build (Ubuntu 24.04, libuv 1.49, curl 8.10)
- PDO MySQL and MySQLi async support
- **TrueAsync API Extensions**: Enhanced async API with new object creation and coroutine grouping capabilities
- Added `ZEND_ASYNC_NEW_GROUP()` API for creating CoroutineGroup objects for managing multiple coroutines
- Added `ZEND_ASYNC_NEW_FUTURE_OBJ()` and `ZEND_ASYNC_NEW_CHANNEL_OBJ()` APIs for creating Zend objects from async primitives
- Extended `zend_async_task_t` structure with `run` method for thread pool task execution
- Enhanced `zend_async_scheduler_register()` function with new API function pointers
- **Multiple Callbacks Per Event Support**: Complete redesign of waker trigger system to support multiple callbacks on a single event
- Modified `zend_async_waker_trigger_s` structure to use flexible array member with dynamic capacity
- Added `waker_trigger_create()` and `waker_trigger_add_callback()` helper functions for efficient memory management
Expand Down
30 changes: 30 additions & 0 deletions async_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,31 @@ void async_await_futures(
await_context->dtor(await_context);
}

static zend_future_t* async_new_future_stub(bool thread_safe, size_t extra_size)
{
return NULL;
}

static zend_async_channel_t* async_new_channel_stub(size_t buffer_size, bool resizable, bool thread_safe, size_t extra_size)
{
return NULL;
}

static zend_object* async_new_future_obj_stub(zend_future_t *future)
{
return NULL;
}

static zend_object* async_new_channel_obj_stub(zend_async_channel_t *channel)
{
return NULL;
}

static zend_async_group_t* async_new_group_stub(size_t extra_size)
{
return NULL;
}

void async_api_register(void)
{
zend_async_scheduler_register(
Expand All @@ -1124,6 +1149,11 @@ void async_api_register(void)
get_awaiting_info,
async_get_class_ce,
(zend_async_new_iterator_t)async_iterator_new,
async_new_future_stub,
async_new_channel_stub,
async_new_future_obj_stub,
async_new_channel_obj_stub,
async_new_group_stub,
engine_shutdown
);
}
Loading