Skip to content

Commit 1cd8a40

Browse files
authored
Merge pull request #40 from true-async/39-add-stubs-for-trueasync-api-050
#39: Add stubs for TrueAsync API 0.5.0
2 parents 34eaee6 + 25ad11d commit 1cd8a40

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Added
1313
- Docker support with multi-stage build (Ubuntu 24.04, libuv 1.49, curl 8.10)
1414
- PDO MySQL and MySQLi async support
15+
- **TrueAsync API Extensions**: Enhanced async API with new object creation and coroutine grouping capabilities
16+
- Added `ZEND_ASYNC_NEW_GROUP()` API for creating CoroutineGroup objects for managing multiple coroutines
17+
- Added `ZEND_ASYNC_NEW_FUTURE_OBJ()` and `ZEND_ASYNC_NEW_CHANNEL_OBJ()` APIs for creating Zend objects from async primitives
18+
- Extended `zend_async_task_t` structure with `run` method for thread pool task execution
19+
- Enhanced `zend_async_scheduler_register()` function with new API function pointers
1520
- **Multiple Callbacks Per Event Support**: Complete redesign of waker trigger system to support multiple callbacks on a single event
1621
- Modified `zend_async_waker_trigger_s` structure to use flexible array member with dynamic capacity
1722
- Added `waker_trigger_create()` and `waker_trigger_add_callback()` helper functions for efficient memory management

async_API.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,31 @@ void async_await_futures(
11041104
await_context->dtor(await_context);
11051105
}
11061106

1107+
static zend_future_t* async_new_future_stub(bool thread_safe, size_t extra_size)
1108+
{
1109+
return NULL;
1110+
}
1111+
1112+
static zend_async_channel_t* async_new_channel_stub(size_t buffer_size, bool resizable, bool thread_safe, size_t extra_size)
1113+
{
1114+
return NULL;
1115+
}
1116+
1117+
static zend_object* async_new_future_obj_stub(zend_future_t *future)
1118+
{
1119+
return NULL;
1120+
}
1121+
1122+
static zend_object* async_new_channel_obj_stub(zend_async_channel_t *channel)
1123+
{
1124+
return NULL;
1125+
}
1126+
1127+
static zend_async_group_t* async_new_group_stub(size_t extra_size)
1128+
{
1129+
return NULL;
1130+
}
1131+
11071132
void async_api_register(void)
11081133
{
11091134
zend_async_scheduler_register(
@@ -1124,6 +1149,11 @@ void async_api_register(void)
11241149
get_awaiting_info,
11251150
async_get_class_ce,
11261151
(zend_async_new_iterator_t)async_iterator_new,
1152+
async_new_future_stub,
1153+
async_new_channel_stub,
1154+
async_new_future_obj_stub,
1155+
async_new_channel_obj_stub,
1156+
async_new_group_stub,
11271157
engine_shutdown
11281158
);
11291159
}

0 commit comments

Comments
 (0)