Summary
zphp should provide a built-in async I/O runtime so PHP applications can handle large numbers of concurrent operations without blocking OS threads.
The event loop should use the best native backend available per platform, such as:
epoll on Linux
kqueue on macOS/BSD
- IOCP on Windows
It should integrate directly with PHP Fibers.
For example:
$data = await($socket->read());
Instead of blocking the thread, the current Fiber should suspend until the operation completes.
Initial scope
Support:
- TCP/UDP sockets
- timers
- DNS
- file descriptors/streams where practical
- cancellation
- timeouts
- wakeups
- Fiber suspension/resume
The runtime should avoid busy polling and unnecessary allocations.
Ideally there should be one reusable event-loop implementation that extensions and higher-level PHP libraries can build on.
Goals
- high concurrency with low thread count
- low idle CPU usage
- efficient native polling
- no blocking of unrelated Fibers
- clean cancellation/shutdown
- no leaks or dangling callbacks
- usable independently of
zphp serve
Summary
zphp should provide a built-in async I/O runtime so PHP applications can handle large numbers of concurrent operations without blocking OS threads.
The event loop should use the best native backend available per platform, such as:
epollon Linuxkqueueon macOS/BSDIt should integrate directly with PHP Fibers.
For example:
Instead of blocking the thread, the current Fiber should suspend until the operation completes.
Initial scope
Support:
The runtime should avoid busy polling and unnecessary allocations.
Ideally there should be one reusable event-loop implementation that extensions and higher-level PHP libraries can build on.
Goals
zphp serve