react/event-loop
ReactPHP’s core event loop for evented I/O. Provides a shared LoopInterface so async libraries interoperate on a single loop with one run() call. Includes timers, future ticks, stream and signal watchers, plus multiple backend implementations.
Architecture fit: Poor for standard Laravel web applications, which are synchronous request-response based. This event loop is designed for async I/O in standalone services, making it incompatible with Laravel's typical HTTP lifecycle. Potential fit only for dedicated background workers or real-time services outside the main app.
Integration feasibility: Low. Requires significant refactoring to replace Laravel's sync model. Must manage PHP extensions (e.g., ext-event, ext-uv) for optimal performance, which are not standard in Laravel deployments. Conflicts with existing async tools like Octane (Swoole/RoadRunner).
Technical risk: High. Mixing sync/async code could cause deadlocks or race conditions. PECL extensions add deployment complexity and platform limitations (e.g., ext-pcntl for signals requires Unix). Low dependents (0) suggests limited real-world adoption in Laravel contexts.
Key questions: How would this integrate with Laravel's request lifecycle? Are there existing Laravel packages that depend on this? What's the maintenance burden for managing PHP extensions? Does the product truly need async I/O, or would Octane be a better fit?
Stack fit: Only suitable for non-web components (e.g., custom daemons, message processors). Not viable for HTTP requests or typical Laravel MVC flow. Would require a completely separate process architecture.
Migration path: No direct path for existing Laravel apps. Must build a new standalone service using ReactPHP components (e.g., react/http), not modifying the Laravel codebase. Could use inter-process communication (e.g., Redis queues) to interface with Laravel.
Compatibility: StreamSelectLoop works without extensions but has poor scalability (>1000 connections). Other implementations require PECL extensions not included in standard PHP builds. Laravel's Homestead/Vagrant environments may need manual extension installation.
Sequencing: 1) Validate async requirements via use cases (e.g., real-time notifications). 2) Build a separate service using ReactPHP's higher-level components (not just the event loop). 3) Isolate from Laravel via message queues or RPC. Never integrate into Laravel's main request cycle.
Maintenance: High overhead for extension management (e.g., updating ext-event with PHP version changes). StreamSelectLoop has lower maintenance but poor scalability. No Laravel-specific tooling for monitoring or debugging async code.
Support: Limited community support for Laravel-ReactPHP integrations. ReactPHP docs are solid, but Laravel developers lack experience
How can I help you explore Laravel packages today?