Integrate Guzzle promises with an event loop
3.0Guzzle promises use an internal task queue to run callbacks asynchronously. When using promises within an external event loop (like ReactPHP), you must periodically run the Guzzle task queue to prevent callbacks from remaining stuck in the queue.
To integrate, call run() on the Guzzle task queue during loop ticks. It is recommended to use a periodic timer rather than a zero-interval timer to avoid keeping the loop busy when no promise work is pending.
$queue = GuzzleHttp\Promise\Utils::queue();
$loop = React\EventLoop\Factory::create();
// Use a periodic timer to drain the Guzzle queue
$loop->addPeriodicTimer(0.01, [$queue, 'run']);