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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Olivier Dolbeau
June 24, 2014
Programming
12
1.9k
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
460
Translating a monolingual application
odolbeau
2
660
DX: Developer eXperience
odolbeau
1
110
DX: Developer eXperience
odolbeau
1
560
EasyAdminBundle introduction
odolbeau
0
200
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
640
Other Decks in Programming
See All in Programming
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.2k
Vibe codingでおすすめの言語と開発手法
uyuki234
0
210
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
620
CSC307 Lecture 07
javiergs
PRO
0
530
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
180
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
270
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
300
CSC307 Lecture 01
javiergs
PRO
0
680
ThorVG Viewer In VS Code
nors
0
750
Data-Centric Kaggle
isax1015
2
720
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
83
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
600
Measuring & Analyzing Core Web Vitals
bluesmoon
9
740
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Game over? The fight for quality and originality in the time of robots
wayneb77
1
90
GraphQLとの向き合い方2022年版
quramy
50
14k
KATA
mclloyd
PRO
34
15k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
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