Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Asynchronous tasks in PHP
Search
Olivier Dolbeau
June 24, 2014
Programming
12
1.8k
Asynchronous tasks in PHP
Why & how making asynchronous tasks in PHP
PHPTour Lyon 2014 - 24/06/2014
Olivier Dolbeau
June 24, 2014
Tweet
Share
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
270
Jane & Webby
odolbeau
0
450
Translating a monolingual application
odolbeau
2
650
DX: Developer eXperience
odolbeau
1
110
DX: Developer eXperience
odolbeau
1
560
EasyAdminBundle introduction
odolbeau
0
190
REX API Platform
odolbeau
0
1.4k
Features flags at BlaBlaCar
odolbeau
5
1.2k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
590
Other Decks in Programming
See All in Programming
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.4k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
210
Developing static sites with Ruby
okuramasafumi
1
340
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
500
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
150
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
310
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
310
SQL Server 2025 LT
odashinsuke
0
120
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
7
4.2k
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
180
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
4
1.1k
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
13k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Cult of Friendly URLs
andyhume
79
6.7k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
110
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
71
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Language of Interfaces
destraynor
162
26k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
35
Code Review Best Practice
trishagee
74
19k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
200
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Transcript
Making asynchronous tasks in PHP
None
Olivier Dolbeau @odolbeau Web Architect About me
RIDESHARING Cost of motoring 100€ 25€ 25€ 25€ 25€ @BlaBlaCar_FR
ALONE
A fast growing community
A European phenomenon
None
None
None
None
None
Your visitors don’t want to wait! and if they have
to, they don’t want to know it
For you :
Your web servers want to make their job! (they don’t
care about emails other boring tasks)
None
Separating concerns Serveur web Consumer Consumer Consumer Consumer Consumer
Separating concerns
None
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 See:
pdezwart/php-amqp Use librabbitmq (alanxz/rabbitmq-c)
How to connect to RabbitMQ?
How to publish a message?
How to consume a message?
None
None
None
None
It’s a trap !
get > consume • consume is a blocking call •
you don’t want blocking calls in your application ! • Use “get” method with a poll-interval
None
None
None
None
None
None
None
Wait 30 seconds and retry!
Wait 3 minutes and retry!
Wait half an hour and retry!
None
None
None
None
Swarrot
Existing processors
None
None
None
Last tip !
None
None
Making asynchronous tasks is good (even in PHP)
@odolbeau https://joind.in/ 11237 https://github.com/swarrot/swarrot https://speakerdeck.com/odolbeau/asynchronous-tasks-in-php