Why & how making asynchronous tasks in PHP
SFLIve2014 - 04/07/2014 with Grégoire Pineau
tasks in PHP
The easy way
● Problems? Solutions!
Your visitors don’t want to wait!
(and if they have to, they don’t want to know it)
First reason to do asynchronous
Your web servers want to make
(they don’t care about emails other boring tasks)
Second reason to do asynchronous
How Rabbit work?
With more consumers
You can add simple routing logic
Or more complex logic
How your app talks to RabbitMQ?
With the PECL extension
Thanks to Pieter de Zwart
Use librabbitmq (alanxz/rabbitmq-c)
How to connect to RabbitMQ?
How to publish a message?
How to consume a message?
get > consume
● consume is a blocking call
● you don’t want blocking calls in your
● Use “get” method with a poll-interval
Wait 30 seconds
Wait 3 minutes
Wait half an hour
You can take a look at the code !