Performance: Job chaining and batching
MEDIUM IMPACT
This affects how background jobs are processed, impacting server load and response time for queued tasks.
JobA::withChain([
new JobB(),
new JobC(),
])->dispatch();dispatch(new JobA()); dispatch(new JobB()); dispatch(new JobC());
| Pattern | Queue Dispatches | Worker Wake-ups | Processing Overhead | Verdict |
|---|---|---|---|---|
| Individual dispatch per job | N | N | High due to repeated overhead | [X] Bad |
| Job chaining for dependent jobs | 1 | 1 per job in chain | Moderate, sequential processing | [!] OK |
| Batching many independent jobs | 1 | Optimized worker usage | Low overhead, parallel processing | [OK] Good |