Asynchronous Request Processing
summary
Argues that heavy disk or DB work should be offloaded and compares Gearman, PHP Resque and RabbitMQ with concrete tradeoffs: RabbitMQ exchanges and routing enable complex routing and message-state backchannel, RabbitMQ supports soft memory limits and prefetching, while PHP Resque is simpler to start with. Advises using use JSON payloads (not PHP serialize), add message headers + versioning and unique IDs, and run consumers under supervisord restarts to avoid long-running PHP memory leaks and stale DB connections; discusses graceful shutdown and requeue behavior.
AI-written summary · about
chapters (12)
- 0:00Introduction to async requests
- 1:06Conventional vs asynchronous handling
- 3:34Overview of queuing systems
- 5:43PHP Resque explained
- 7:54RabbitMQ basics
- 10:08Lessons learned from implementations
- 13:01Memory and prefetching tips
- 15:26Message order dependencies
- 17:37Message format best practices
- 20:10Deployment challenges
- 22:18Other challenges and advice
- 24:08Summary and Q&A
