Skip to content
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

[11.x] Execute event listener using Fiber #53689

Closed
wants to merge 1 commit into from

Conversation

robertogallea
Copy link

Summary
This PR introduces the ability to execute Event Listeners using PHP Fibers. This enhancement can significantly improve performance, especially when the sync driver is used for event dispatching.

How it works
To leverage this feature, a Listener class simply needs to include the RunsOnFiber trait—no additional setup required. The event dispatcher automatically detects listeners using this trait and executes their handling logic inside a Fiber. The RunsOnFiber trait provides a built-in decorator to handle the execution seamlessly.

This approach ensures a lightweight integration of Fibers, offering better responsiveness and concurrency for event-driven workflows.

@robertogallea robertogallea changed the title Execute event listener using Fiber [11.x] Execute event listener using Fiber Nov 27, 2024
@taylorotwell
Copy link
Member

Please provide before and after benchmarks in a real world scenario. 👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants