PSR for async libraries

43 views
Skip to first unread message

Italo Baeza Cabrera

unread,
May 6, 2021, 5:41:46 PM5/6/21
to PHP Framework Interoperability Group
Hi.

Following the auge of async libraries and introduction of Fiber at the end of the year, its very weird no PSR regarding async implementation has been actively discussed.

In my humble opinion, a PSR-21 for async libraries, specifically the Event Loop and Promises, would allow async libraries interoperability regardless of how these handle the asynchronous execution internally themselves. For example, a library asking for PSR-21 would allow the project using that library to swap Amp, ReactPHP, Swoole, or anything else.

Using the same Event Loop, packages would not conflict over the Loop execution, while a common Promise interface wouldn't lock the API inside async contexts.
Reply all
Reply to author
Forward
0 new messages