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.8k
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
180
Jane & Webby
odolbeau
0
370
Translating a monolingual application
odolbeau
2
520
DX: Developer eXperience
odolbeau
1
71
DX: Developer eXperience
odolbeau
1
530
EasyAdminBundle introduction
odolbeau
0
160
REX API Platform
odolbeau
0
1.3k
Features flags at BlaBlaCar
odolbeau
5
1k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
470
Other Decks in Programming
See All in Programming
Java 24まとめ / Java 24 summary
kishida
3
450
[NG India] Event-Based State Management with NgRx SignalStore
markostanimirovic
0
110
AHC 044 混合整数計画ソルバー解法
kiri8128
0
320
Signal-Based Data FetchingWith the New httpResource
manfredsteyer
PRO
0
160
地域ITコミュニティの活性化とAWSに移行してみた話
yuukis
0
230
Ruby's Line Breaks
yui_knk
2
470
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
3
1.2k
Do Dumb Things
mitsuhiko
0
420
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
200
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
15
4.5k
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
890
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
220
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
How to Think Like a Performance Engineer
csswizardry
23
1.5k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Fireside Chat
paigeccino
37
3.4k
Building Adaptive Systems
keathley
41
2.5k
Automating Front-end Workflow
addyosmani
1369
200k
Music & Morning Musume
bryan
47
6.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
For a Future-Friendly Web
brad_frost
176
9.7k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Site-Speed That Sticks
csswizardry
5
480
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
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