guzzlehttp/promises
Iterative promise chaining for infinite async operations with Guzzle HTTP. Supports Promises/A+ compliance, coroutine-style await via Coroutine::of(), and synchronous wait() method. Cancel promises mid-execution and handle rejection/fulfillment callbacks cleanly. Works with any object with a then()...
Architecture fit: This package is a foundational async primitive for PHP applications, especially within the Guzzle ecosystem. It integrates seamlessly with Laravel's HTTP client (which depends on Guzzle), making it ideal for handling asynchronous HTTP requests and custom async workflows. Its Promises/A+ compliance ensures compatibility with standard async patterns.
Integration feasibility: High feasibility due to Composer-based installation and existing dependencies in Laravel. No additional configuration needed beyond requiring the package, as Guzzle automatically pulls it in. Direct usage requires minimal code changes for async operations.
Technical risk: Low risk. The package is mature (7720+ stars), MIT-licensed, and has clear version guidance. However, PHP version compatibility must be verified (v2.x requires >=7.2.5, <8.6). Potential risk if misusing synchronous wait in high-throughput scenarios without proper task queue management.
Key questions:
Stack fit: Ideal for Laravel applications using Guzzle for HTTP clients. Also suitable for custom async tasks where non-blocking operations are needed (e.g., parallel API calls). Fits into existing Laravel service containers without conflicts.
Migration path: If replacing another promise library (e.g., ReactPHP), interop is straightforward via then method compatibility. For new projects, simply require and use. Existing Guzzle-based code already uses this package, so no migration needed for HTTP operations.
Compatibility: Fully compatible with ReactPHP promises and other then-compatible libraries. Works with Laravel's event system when task queues are integrated. PHP 7.2.5+ required for latest version.
Sequencing:
new Promise() or FulfilledPromise/RejectedPromise.then(), handling resolution/rejection.Maintenance: Minimal overhead. Updates are handled via Guzzle dependency
How can I help you explore Laravel packages today?