huang-yi/shadowfax
Shadowfax is a Laravel package for sending HTTP requests concurrently, making it easy to run multiple requests in parallel and handle responses efficiently. Built on Guzzle, it offers a simple API to reduce wait times when your app depends on several external services.
Architecture fit. Shadowfax inverts Laravel's request lifecycle: instead of bootstrapping the framework on every request under PHP-FPM, it boots the application once inside a Swoole worker and handles each request in a coroutine that receives a sandboxed copy of the container. That is the same fundamental model as Laravel Octane's Swoole worker. The fit question for a TPM is therefore not "does it work" but "does our application tolerate long-lived processes and concurrent coroutines?" Stateless JSON/API services fit well. Applications dependent on per-request globals, request-scoped singletons, or non-coroutine-safe extensions fit poorly, and the burden of proving safety falls on our dependency audit, not on the package.
Integration feasibility. Installation is cheap (Composer package, service provider, published config, an artisan server command). Validation is expensive. The real integration cost is auditing every third-party package for coroutine safety and demonstrating that no state leaks between concurrent requests — an effort that frequently exceeds the performance upside.
Technical risk.
Key questions. What Laravel/PHP/Swoole versions are supported today, beyond the 2022 release notes? Is the repository still accepting fixes, or is it de facto archived? Which of our dependencies hold static or global state? What is our rollback path if a coroutine bug corrupts responses? And critically — is Octane acceptable as an alternative, and if not, what concrete requirement rules it out?
Stack fit. Viable where the workload is predominantly stateless HTTP and the team already runs Swoole or is comfortable compiling and operating PHP extensions. Poor fit for apps with heavy session/file-upload handling, legacy libraries, or a long tail of unmaintained packages that cannot be certified coroutine-safe.
Migration path. Treat Shadowfax as a parallel runtime, never a big-bang cutover. Run the identical application under PHP-FPM and under Shadowfax behind the same load balancer, canary a small traffic slice, and compare p50/p99 latency, error rate, and per-worker memory against a fixed baseline. Keep FPM hot as the fallback so rollback is a routing change, not a redeploy.
Compatibility. Pin an explicit PHP × Swoole × Laravel matrix and run the full dependency suite in CI under the Swoole runtime, not only under FPM. Verify that CLI paths — queue workers, scheduler, migrations — are untouched (they run outside the server and normally are, but confirm). Validate that session/cache drivers and database connections are coroutine-safe; shared PDO usage is a known footgun.
Sequencing.
Maintenance. The package is effectively unmaintained: one 2022 release, low activity, single maintainer. Every Laravel major upgrade becomes a gamble, and there is a realistic possibility we end up owning a fork. Octane, by contrast, is maintained in lockstep with the framework. Budget for fork ownership before committing.
Support. No vendor SLA, no paid tier, no corporate backing. Escalation is a GitHub issue on a low-activity repository. Internal expertise must be built and retained, which is a staffing risk as much as a technical one.
Scaling. Per-worker throughput improves because bootstrap cost is paid once, so fewer workers are needed for the same RPS. This does not remove the need for horizontal scaling, connection-pool sizing, or worker-count tuning. Worker recycling (max_request) must be configured deliberately to bound memory growth, and coroutine concurrency limits must be set against upstream capacity.
Failure modes. Gradual OOM from leaks in long-lived workers; cross-request state leakage (worst case, one user seeing another's data); a single blocking call stalling every coroutine in a worker; an unhandled exception terminating a worker; a Swoole extension upgrade silently breaking the app; and operators debugging with FPM assumptions because the documentation is stale.
Ramp-up. The team needs Swoole and coroutine mental models, which differ materially from FPM: request isolation is no longer free, and reload/restart semantics change. Runbooks, health checks, and alerting must be rewritten. Plan for a multi-week learning curve before on-call is genuinely comfortable, and instrument Swoole-specific metrics (coroutine count, worker memory, reload events) from day one.
How can I help you explore Laravel packages today?