Re: async/await - is future reserved words in PHP 7.x?

From: Date: Tue, 29 Sep 2015 18:04:07 +0000
Subject: Re: async/await - is future reserved words in PHP 7.x?
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-88563@lists.php.net to get a copy of this message
> 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? :)

« previous php.internals (#88563) next »