Skip to content

Conversation

EdmondDantes
Copy link
Contributor

   Expose async_scheduler_launch() function through the TrueAsync API to allow
   extensions to explicitly initialize and start the scheduler before creating
   coroutines. This is particularly useful for extensions that need deterministic
   scheduler initialization timing.

   Changes:
   - Add zend_async_scheduler_launch_t function pointer type
   - Add ZEND_ASYNC_SCHEDULER_LAUNCH() macro for scheduler initialization
   - Register scheduler_launch_fn as first parameter in zend_async_scheduler_register()
   - Update CHANGELOG.md with API addition in version 0.5.0

       Expose async_scheduler_launch() function through the TrueAsync API to allow
       extensions to explicitly initialize and start the scheduler before creating
       coroutines. This is particularly useful for extensions that need deterministic
       scheduler initialization timing.

       Changes:
       - Add zend_async_scheduler_launch_t function pointer type
       - Add ZEND_ASYNC_SCHEDULER_LAUNCH() macro for scheduler initialization
       - Register scheduler_launch_fn as first parameter in zend_async_scheduler_register()
       - Update CHANGELOG.md with API addition in version 0.5.0
@EdmondDantes EdmondDantes added this to the RFC v1.4 milestone Oct 1, 2025
@EdmondDantes EdmondDantes requested a review from Copilot October 1, 2025 12:10
@EdmondDantes EdmondDantes self-assigned this Oct 1, 2025
@EdmondDantes EdmondDantes added the enhancement New feature or request label Oct 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds ZEND_ASYNC_SCHEDULER_LAUNCH() to the TrueAsync public API to allow extensions to explicitly initialize and start the scheduler before creating coroutines, providing deterministic scheduler initialization timing.

  • Added function pointer type and macro for scheduler initialization in the public API
  • Updated scheduler registration to include the launch function as a parameter
  • Added performance optimization using UNEXPECTED() macro for fiber check

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
scheduler.c Performance optimization with UNEXPECTED() macro for fiber check
async_API.c Updated scheduler registration to include async_scheduler_launch function
CHANGELOG.md Documented the new API addition in version 0.5.0

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@EdmondDantes EdmondDantes merged commit aa9561b into main Oct 1, 2025
1 check passed
@EdmondDantes EdmondDantes deleted the 66-add-the-ability-to-activate-the-scheduler-from-php-core-into-the-zend-async-api branch October 1, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to activate the scheduler from PHP CORE into the ZEND ASYNC API.
1 participant