7 ms·
Fibers are incredibly powerful, as they can be used to implement seamless go-like concurrency with async, colorless functions. They were added to PHP by the ma
by danogentili 1y ago
Fibers are incredibly powerful, as they can be used to implement seamless go-like concurrency with async, colorless functions.
They were added to PHP by the maintainers of amphp (https://amphp.org https://amphp.org), which is the best library for async PHP out there, providing a clean, object-oriented and async API for files, databases and everything that can make use of async I/O.
- donatj 1y agoA fiber is a colored function. It's a different color than an async function, but it's not blindly swapable for a regular function.
- danogentili 1y agoAsync functions based on PHP fibers are explicitly uncolored, they do not require any special keywords to be invoked, and are explicitly swappable with any regular functions.