Don’t Wait; Generate!
By Ian Littman
Generators introduce sanity to the world of asynchronous, concurrent execution within a single process. In this article, we’ll look at what generators are, how they show up in PHP, and how they make concurrency a bit more sane compared to callback and promise alternatives. Then, we’ll see what a PHP application looks like when built on top of a generator-based framework instead of the typical “run one process per request and block on I/O” approach.
This article was originally published in the January 2018 issue of php[architect] magazine. To read the complete article please subscribe or purchase the complete issue.
Leave a comment
Use the form below to leave a comment: