> Implementing elegant, readable, and stable asynchronous code in userland PHP > code is very possible. In fact, I’ve done exactly this with Icicle > (https://github.com/icicleio/icicle). Icicle uses generators and promises to > implement coroutines. When a coroutine yields a promise, the coroutine is > interrupted until the promise resolves, sending or throwing the resolution > value into the generator. While a coroutine is interrupted, other code in the > program is given the chance to be executed. This behavior is similar to > async/await, instead using a generator as the async function and yield as > await. There are several packages available for Icicle that implement > non-blocking I/O and concurrency (multithreading). There are no extensions > required for Icicle and no black magic – just making good use of the tools > already available. >
My experience says that callback, promise, yield, not transparent as the async/await in С#. In other languages: Python - coroutines with async and await https://www.python.org/dev/peps/pep-0492/ ECMAScript https://github.com/lukehoban/ecmascript-asyncawait When Node.js appear async/await, many developers and projects will migrate to a Node.js, if PHP is not implement async APIs. Hopefully, Dmitry Stogov and others, will make another surprise: PHP-Next-Async? :) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php