External processes? Hold my beer, said the Laravel developer

Peter Hrobar
3 min readJun 4, 2023

To complete my miniseries (Part 1: Worker Pool design pattern with PHP, Part 2: Share nothing, copy by value and go \parallel) on parallel processing I’m going to show you how to implement the Worker Pool design pattern using Laravel.

Starting from Laravel 10.x, developers can use a minimal API around the Symfony Process component to manage external processes.

I know, I know … Laravel has an advanced queue management system that can be used for our example (just a reminder we have a queue with messages waiting to be transferred to various recipients). Let us just assume that this is some sort of legacy system that can not be incorporated into our shiny Laravel application entirely.

On the other hand it would not be a Hold my beer situation if I would use the obvious choice.

Anyway, I will try to replicate what you have already seen in Part 1 and Part 2 as close as possible so we can have an apple-to-apple comparison.

PHP parallel processing was mainly a CLI business. With Laravel 10.x you can achieve the same in your web applications.

Not so much surprisingly you do not have to do anything complicated. Laravel is a wonderful framework which makes parallel processing hassle free … :-)

--

--