|
|
|
|
|
by kijin
342 days ago
|
|
Contrived examples are okay if they help trigger a click in the reader's mind, "wow, I could use this to solve problem X in an actual project!" The difficulty with these examples is that they are very different from the actual tasks that everyday web developers would like to parallelize, such as long-running database queries and API requests. These things often take orders of magnitude longer than any pure-PHP loop that a typical webapp might contain. An example that fires off an async query and yields the result when it's ready will probably produce the right click in the minds of many more people. (mysqli can do this, but the interface is convoluted and badly in need of a Promise-like wrapper. I'm not sure if PDO/PostgreSQL even supports async queries.) |
|