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
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
500
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
2
700
How to stabilize UI tests using XCTest
akkeylab
0
130
20260315 AWSなんもわからん🥲
chiilog
2
160
The free-lunch guide to idea circularity
hollycummins
0
270
OTP を自動で入力する裏技
megabitsenmzq
0
120
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
230
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
0
120
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
290
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
270
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
260
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
410
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
300
Navigating Weather and Climate Data
rabernat
0
140
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Ethics towards AI in product and experience design
skipperchong
2
230
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
470
Making the Leap to Tech Lead
cromwellryan
135
9.8k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
New Earth Scene 8
popppiees
1
1.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Amusing Abliteration
ianozsvald
0
140
Joys of Absence: A Defence of Solitary Play
codingconduct
1
310
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