public/index.php modification).server:start, cron:run, task:dispatch) align with Symfony’s CLI ecosystem.config/packages/swoole.yaml or .env.go(), yield) for advanced use cases (e.g., custom async logic).LISTEN).cron_worker, task_worker).
public/index.php and configure swoole.yaml.APP_SERVER=swoole|phpfpm) for runtime switching.pecl install swoole).
go() and yield—ensure PHP version supports it (PHP 8.1+ recommended).LISTEN (PostgreSQL) or SUBSCRIBE (Redis).| Step | Action | Dependencies | Validation |
|---|---|---|---|
| 1. Setup | Install bundle, update index.php, configure swoole.yaml. |
Symfony 8+, Swoole extension. | Basic HTTP routes work. |
| 2. HTTP Load Test | Benchmark with server:watch (dev) or server:start (prod). |
Load testing tool (k6). | Latency < target, no crashes. |
| 3. Task Migration | Replace Symfony Messenger jobs with Swoole tasks. | Existing job logic. | Tasks dispatch/retry correctly. |
| 4. Cron Jobs | Migrate cron jobs to AbstractCronJob. |
Cron expressions. | Jobs run at correct intervals. |
| 5. Process Workers | Add PostgreSQL/Redis listeners as process workers. | External event sources. | Events processed without errors. |
| 6. WebSocket Integration | Implement WebSocket handler if needed. | Real-time features. | Connections stable, messages delivered. |
| 7. Monitoring | Add Swoole metrics (coroutines, task queue) to Prometheus. | Monitoring stack. | Alerts trigger for anomalies. |
| 8. Rollout | Deploy to staging/production with canary traffic. | CI/CD pipeline. | No regressions in key metrics. |
server:watch) auto-reloads on code changes.swoole.yaml and .env variables can become unwieldy at scale.How can I help you explore Laravel packages today?