Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Promises Laravel Package

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()...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: This package remains a foundational async primitive for PHP applications, particularly within the Guzzle ecosystem. Its seamless integration with Laravel's HTTP client (which depends on Guzzle) makes it ideal for asynchronous HTTP requests and custom async workflows. The Promises/A+ compliance ensures compatibility with standard async patterns, and the recent fix in v2.4.1 (coroutine cancellation handling) further solidifies its reliability in edge cases.

Integration feasibility: High feasibility persists due to Composer-based installation and Laravel's existing Guzzle dependency. No additional configuration is required beyond requiring the package. Direct usage for async operations remains minimal, though the coroutine fix may necessitate review of cancellation-heavy workflows (e.g., long-running tasks with explicit cancellation).

Technical risk: Low risk, but slightly elevated for applications relying on coroutine cancellation. The package is mature (7720+ stars), MIT-licensed, and maintains clear version guidance. PHP version compatibility remains unchanged (v2.x requires >=7.2.5, <8.6). Potential risks persist if synchronous waits are misused in high-throughput scenarios without proper task queue management. The v2.4.1 fix mitigates a niche but critical edge case for coroutine-heavy applications.

Key questions:

  • What PHP version is the application targeting?
  • Are there existing async workflows that leverage coroutine cancellation (e.g., CLI workers, long-running tasks)?
  • How will task queue execution be managed in non-HTTP request contexts (e.g., CLI workers)?
  • Does the team have experience with promise-based async patterns, including cancellation?
  • Are there any custom coroutine implementations that might interact with this fix?

Integration Approach

Stack fit: Ideal for Laravel applications using Guzzle for HTTP clients. Also suitable for custom async tasks requiring non-blocking operations (e.g., parallel API calls). The package fits seamlessly into Laravel's service container without conflicts. The v2.4.1 fix ensures stability for coroutine cancellation, which may be relevant for advanced async workflows.

Migration path: If replacing another promise library (e.g., ReactPHP), interoperability remains straightforward via then method compatibility. For new projects, simply require and use. Existing Guzzle-based code already leverages this package, so no migration is needed for HTTP operations. The coroutine fix may require validation of cancellation logic in custom async workflows.

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 the latest version. The v2.4.1 fix does not introduce breaking changes but may impact cancellation behavior in edge cases.

Sequencing:

  1. Ensure Guzzle is installed (via Laravel's framework dependencies).
  2. For custom async logic, create promises using new Promise() or FulfilledPromise/RejectedPromise.
  3. Chain operations with then(), handling resolution/rejection.
  4. In event loop contexts (e.g., ReactPHP), schedule task queue execution.
  5. For coroutine-heavy applications, validate cancellation logic post-upgrade to ensure the v2.4.1 fix behaves as expected.

Operational Impact

Maintenance: Minimal overhead. Updates are handled via Guzzle dependency. The v2.4.1 fix reduces the risk of memory leaks or dangling coroutines in cancellation scenarios, improving long-term stability.

Support: Existing support channels (GitHub issues, documentation) remain unchanged. The fix may require additional testing for applications with complex coroutine workflows, but no new support burden is introduced.

Scaling: No impact on scaling. The fix optimizes resource cleanup in cancellation scenarios, which may indirectly improve performance in high-concurrency environments by preventing leaks.

Failure modes: The v2.4.1 fix mitigates a previously undocumented edge case where settled coroutines might not release resources properly during cancellation. Applications relying on explicit coroutine cancellation should verify behavior post-upgrade. Otherwise, failure modes remain unchanged.

Ramp-up: No additional training is required. The fix is transparent to most users, but teams using coroutine cancellation should review their workflows. Documentation and examples remain sufficient for standard use cases.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope