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.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
290
Jane & Webby
odolbeau
0
470
Translating a monolingual application
odolbeau
2
670
DX: Developer eXperience
odolbeau
1
120
DX: Developer eXperience
odolbeau
1
570
EasyAdminBundle introduction
odolbeau
0
210
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
650
Other Decks in Programming
See All in Programming
Raku Raku Notion 20260128
hareyakayuruyaka
0
430
AIに仕事を丸投げしたら、本当に楽になれるのか
dip_tech
PRO
0
180
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.6k
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
160
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
210
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
TipKitTips
ktcryomm
0
150
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
110
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
420
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
230
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
680
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
160
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
87
AI: The stuff that nobody shows you
jnunemaker
PRO
3
350
WENDY [Excerpt]
tessaabrams
9
36k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
450
First, design no harm
axbom
PRO
2
1.1k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How to make the Groovebox
asonas
2
2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
330
What does AI have to do with Human Rights?
axbom
PRO
1
2k
A designer walks into a library…
pauljervisheath
210
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
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