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

Promise Timer Laravel Package

react/promise-timer

Add timeouts and sleep delays to ReactPHP promises. Wrap any pending operation to auto-cancel and reject with a TimeoutException if it doesn’t settle in time, or pass through resolve/reject when it does. Lightweight, function-based API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables reliable timeout handling for async operations in event-driven PHP applications (e.g., API gateways, microservices), preventing resource leaks from hanging network calls or database queries
  • Critical for building resilient systems where uncontrolled delays could cascade into outages; reduces need for custom timeout logic in core business logic
  • Strong "buy" case: lightweight (1 file), MIT-licensed, and battle-tested in ReactPHP ecosystem – building in-house would duplicate effort with higher maintenance risk
  • Use cases: background job processing with strict SLAs, third-party API integrations requiring fail-fast behavior, and high-concurrency queue workers needing deterministic cancellation

When to Consider This Package

Adopt when:

  • Your application uses ReactPHP or async PHP patterns (e.g., Laravel Octane with Swoole/ReactPHP, custom event-driven workers)
  • You need precise promise-based timeout semantics with automatic cancellation of underlying operations
  • You're building low-latency systems where unhandled delays would degrade user experience or system stability

Look elsewhere when:

  • Using Laravel's built-in HTTP client or synchronous code (native curl/stream_context timeouts suffice)
  • Requirements involve non-Promise-based scheduling (e.g., cron jobs, task queues – use Laravel Horizon or Redis queues instead)
  • Your project doesn't leverage event loops (e.g., traditional monolithic PHP apps without async capabilities)
  • Need advanced scheduling beyond simple timeouts (e.g., retry policies, jitter – consider dedicated libraries like spatie/async or reactphp/event-loop extensions)

How to Pitch It (Stakeholders)

Executives: "This tiny open-source package ensures our systems stay responsive under load by automatically terminating slow operations – preventing cascading failures and reducing server costs. It’s a proven, zero-maintenance tool that protects customer experience without engineering overhead."

Engineering: "A lightweight, battle-tested ReactPHP utility that adds deterministic timeouts to promises with proper cancellation semantics. Integrates in minutes via Composer, avoids reinventing timeout logic, and handles edge cases like promise cancellation and resource cleanup out-of-the-box. Perfect for async Laravel workers or microservices needing fail-fast behavior."

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport