Let's take a look at this typical PHP code: function names() { $data = Http::get('data.location/products')->json(); $names = []; foreach ($data as $item){ $names[] = $item['name']; } return $names; } We send an HTTP request that returns an array of items, then we store the name of each item in a $names array. Executing this function will take time that's equal to the duration of the request plus the time it took to build the array.

In other words, the available cores will switch between processing our two processes and other processes.

So if we break down our code, it comes to this: go(function(){ $data = Http::get('data.location/products')->json(); // yields foreach(..).
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners