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.7k
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
0
110
Jane & Webby
odolbeau
0
330
Translating a monolingual application
odolbeau
2
470
DX: Developer eXperience
odolbeau
0
62
DX: Developer eXperience
odolbeau
0
500
EasyAdminBundle introduction
odolbeau
0
160
REX API Platform
odolbeau
0
1.2k
Features flags at BlaBlaCar
odolbeau
4
960
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
1
440
Other Decks in Programming
See All in Programming
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
MCP with Cloudflare Workers
yusukebe
2
220
From Translations to Multi Dimension Entities
alexanderschranz
2
140
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
Exploring: Partial and Independent Composables
blackbracken
0
100
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
103 Early Hints
sugi_0000
1
240
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Featured
See All Featured
Become a Pro
speakerdeck
PRO
26
5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
4 Signs Your Business is Dying
shpigford
181
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
RailsConf 2023
tenderlove
29
940
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Building Adaptive Systems
keathley
38
2.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Optimising Largest Contentful Paint
csswizardry
33
3k
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