-
-
Notifications
You must be signed in to change notification settings - Fork 3
Async event loop
Greg Bowler edited this page May 1, 2025
·
3 revisions
PHP is a procedural language — it won’t call your Deferred
's processing function automatically. For your promises to resolve, you’ll need an event loop to run the pending processes.
This could be a simple loop like:
while($runner->hasPendingTasks()) {
$runner->tick();
}
For production use, consider using a solution built for looping PHP. PHP.GT/async is the complementary library for handling asynchronous looping, which is built to coordinate these tasks efficiently in real-world PHP environments.
PHP.GT/Promise is a separately maintained component of PHP.GT/WebEngine.