Parallel Task Execution in PHP... with Go
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
Gyproc is a small Go tool (~200 lines) that enables parallel task execution from PHP by delegating concurrency to Go goroutines. PHP, being inherently blocking, sends a list of commands to Gyproc, which runs them in parallel and streams back a newline-delimited JSON event stream. Each event is tagged with a `seq` identifier so the PHP client can track individual process progress, output, and exit codes in real time. The post compares alternatives like shell backgrounding, `pcntl`, and `spatie/async`, explaining why each falls short, then walks through a concrete image-resizing example using ImageMagick with a concurrency limit.
Table of contents
The alternatives I considered #Assuming the blocking nature of PHP #The key advantage: seq #A PHP client implementation #A concrete example: resizing images in parallel #Conclusion #Sort: