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
1.9k
12
Share
Asynchronous tasks in PHP
Why & how making asynchronous tasks in PHP
PHPTour Lyon 2014 - 24/06/2014
Olivier Dolbeau
June 24, 2014
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
300
Jane & Webby
odolbeau
0
490
Translating a monolingual application
odolbeau
2
680
DX: Developer eXperience
odolbeau
1
130
DX: Developer eXperience
odolbeau
1
580
EasyAdminBundle introduction
odolbeau
0
220
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
660
Other Decks in Programming
See All in Programming
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
210
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
400
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
640
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
240
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
220
AIエージェントで業務改善してみた
taku271
0
540
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
990
Kingdom of the Machine
yui_knk
2
780
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
850
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Six Lessons from altMBA
skipperchong
29
4.2k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
230
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
190
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
Documentation Writing (for coders)
carmenintech
77
5.3k
A Tale of Four Properties
chriscoyier
163
24k
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