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
310
Jane & Webby
odolbeau
0
490
Translating a monolingual application
odolbeau
2
690
DX: Developer eXperience
odolbeau
1
130
DX: Developer eXperience
odolbeau
1
580
EasyAdminBundle introduction
odolbeau
0
230
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
670
Other Decks in Programming
See All in Programming
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
1
170
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
220
PHPer、Cloudflare に引っ越す
suguruooki
2
230
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
3.2k
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
860
Sans tests, vos agents ne sont pas fiables
nabondance
0
140
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
0
120
【ディップ|26年新卒研修資料】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
170
20260514_its_the_context_window_stupid.pdf
heita
0
1k
【ディップ|26年新卒研修資料】TDD実装演習
dip_tech
PRO
0
190
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
0
220
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
760
Information Architects: The Missing Link in Design Systems
soysaucechin
0
930
It's Worth the Effort
3n
188
29k
Designing for Performance
lara
611
70k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Music & Morning Musume
bryan
47
7.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Visualization
eitanlees
151
17k
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