FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
PHP 8.3 Fibers for Concurrent API Calls
How-ToProgramming Languages

PHP 8.3 Fibers for Concurrent API Calls

via Dev.to Tutorialahmet gedik4h ago

Introduction When your application needs to call multiple external APIs — like fetching trending videos from 7 different regions — doing it sequentially is slow. PHP 8.1 introduced Fibers, and PHP 8.3 made them production-ready. Here's how I use Fibers on ViralVidVault to fetch data from multiple YouTube API endpoints concurrently. The Problem: Sequential API Calls // Sequential: ~7 seconds for 7 regions (1s each) foreach ([ 'US' , 'GB' , 'PL' , 'NL' , 'SE' , 'NO' , 'AT' ] as $region ) { $results [ $region ] = fetchTrending ( $region ); // ~1 second each } // Total: 7 * 1s = ~7 seconds The Solution: Fibers + curl_multi Fibers don't make I/O faster by themselves — they provide cooperative multitasking. Combined with curl_multi , they let you run multiple HTTP requests in parallel: <?php class ConcurrentFetcher { private array $fibers = []; private \CurlMultiHandle $multiHandle ; private array $handles = []; public function __construct () { $this -> multiHandle = curl_multi_init (); } pu

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles

MediatR: How to setup a Request Handler? — ASP.NET CORE
How-To

MediatR: How to setup a Request Handler? — ASP.NET CORE

Medium Programming • 4h ago

What Makes a Good Open Source PR (Lessons From Getting Mine Closed)
How-To

What Makes a Good Open Source PR (Lessons From Getting Mine Closed)

Dev.to • 5h ago

Hoto’s powerful PixelDrive electric screwdriver is 25 percent off
How-To

Hoto’s powerful PixelDrive electric screwdriver is 25 percent off

The Verge • 5h ago

How I turned my Pixel phone into a genuinely productive desktop computer - for free
How-To

How I turned my Pixel phone into a genuinely productive desktop computer - for free

ZDNet • 7h ago

the world is your oyster - you can just do things.
How-To

the world is your oyster - you can just do things.

Medium Programming • 7h ago

Discover More Articles