Series of examples to demonstrate asynchronous PHP for the talk State of Async PHP.
After running composer install
, in the terminal just type in:
php examples/{your-prefered-example-file.php}
This will run the given example.
Github Link.
Install Swoole from here.
YouTube Link: https://www.youtube.com/watch?v=j04kDO7kVFY
Slides: https://slides.com/saadbinamjad/state-of-async-php
wrk - a HTTP benchmarking tool wrk.
I highly recommend these resources on Asynchronous Programming and Asynchronous PHP. You can go through these video and reading materials for having more in-depth knowledge on this topic, this is a growing list:
- PHP 25 years: https://www.jetbrains.com/lp/php-25/
- Guzzle: https://docs.guzzlephp.org/en/stable/
- Spatie: https://github.com/spatie/async
- ReactPHP: https://reactphp.org/
- Amp PHP: https://amphp.org/amp/
- Swoole: https://www.swoole.co.uk/how-it-works
- Roadrunner: https://roadrunner.dev/
- Octane: https://github.com/laravel/octane
Youtube Videos:
- https://www.youtube.com/watch?v=qKQcUDEo-ZI
- https://youtu.be/2vKnGX-bIu0
- https://www.youtube.com/watch?v=yhP0XWakCSo
- https://www.youtube.com/watch?v=SpmnVDYwr_g&t=223s
- https://www.youtube.com/watch?v=X_nGKTxpXR4
- https://www.youtube.com/watch?v=oV9rvDllKEg
- https://www.youtube.com/watch?v=XoDBtz5P8q8
- https://www.youtube.com/watch?v=YEKjSzIwAdA
Articles:
- https://divinglaravel.com/asynchronous-php
- https://nodejs.org/en/docs/guides/dont-block-the-event-loop/
- https://www.backblaze.com/blog/whats-the-diff-programs-processes-and-threads/
- https://www.perforce.com/blog/qac/multithreading-parallel-programming-c-cpp
- https://eloquentjavascript.net/11_async.html
- https://www.zend.com/blog/swoole
- https://php.watch/versions/8.1/fibers
- https://sergeyzhuk.me/2021/03/03/myths-about-asynchronous-php/
- https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Concepts
- https://docs.microsoft.com/en-us/archive/msdn-magazine/2011/october/asynchronous-programming-async-performance-understanding-the-costs-of-async-and-await
- https://softwareengineering.stackexchange.com/questions/208469/benchmark-of-asynchronous-code
- https://engagedphp.com/2019/03/multithreaded-processing-with-swoole/
- https://medium.com/trendyol-tech/concurrency-and-channels-in-go-bbc4dea75286
- https://medium.com/@itIsMadhavan/concurrency-vs-parallelism-a-brief-review-b337c8dac350
Misc:
- Ramsay's 10 minute: https://www.youtube.com/watch?v=HrNLvCO2tE4