top | item 44499413

(no title)

danogentili | 7 months 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), 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.

discuss

order

donatj|7 months ago

A 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|7 months ago

Async 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.