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
Making asynchronous tasks in PHP
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Olivier Dolbeau
April 07, 2014
Programming
3.7k
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Making asynchronous tasks in PHP
Why & how making asynchronous tasks in PHP
SFLIve2014 - 04/07/2014 with Grégoire Pineau
Olivier Dolbeau
April 07, 2014
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
340
Jane & Webby
odolbeau
0
520
Translating a monolingual application
odolbeau
2
700
DX: Developer eXperience
odolbeau
1
140
DX: Developer eXperience
odolbeau
1
590
EasyAdminBundle introduction
odolbeau
0
250
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
690
Other Decks in Programming
See All in Programming
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
130
リアルな遅延を測る仕様
kota_yata
1
130
Cloudflare is Agents
chimame
0
190
XHTMLが残したもの
yosuke_furukawa
PRO
1
260
MySQLとPostgreSQLって何が違うの?
akagami
0
150
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.4k
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
280
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
780
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
360
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.4k
Oxlintはいいぞ(続)
yug1224
1
510
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
220
Featured
See All Featured
ラッコキーワード サービス紹介資料
rakko
1
4.7M
Design in an AI World
tapps
1
290
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
880
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Product Roadmaps are Hard
iamctodd
55
13k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
540
The Limits of Empathy - UXLibs8
cassininazir
1
630
Mind Mapping
helmedeiros
PRO
1
340
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
680
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
500
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Transcript
Making asynchronous tasks in PHP The easy way
Olivier Dolbeau Dev @odolbeau Who ? Grégoire Pineau Dev @lyrixx
Summary • Why? • How? • Problems? Solutions! • Tips
None
None
None
None
None
None
Your visitors don’t want to wait! (and if they have
to, they don’t want to know it) First reason to do asynchronous
Your web servers want to make their job! (they don’t
care about emails other boring tasks) Second reason to do asynchronous
None
Separating concerns Serveur web Consumer Consumer Consumer Consumer Consumer
None
How Rabbit work?
With more consumers
You can add simple routing logic
Or more complex logic
None
How your app talks to RabbitMQ?
With the PECL extension Thanks to Pieter de Zwart See:
pdezwart/php-amqp Use librabbitmq (alanxz/rabbitmq-c)
With videlalvaro/php-amqplib
None
</troll>
How to connect to RabbitMQ?
How to publish a message?
How to consume a message?
None
None
None
None
None
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
None
None
None
Wait 30 seconds and retry!
Wait 3 minutes and retry!
Wait half an hour and retry!
None
None
None
None
None
None
<troll>
None
None
None
You can take a look at the code ! https://github.com/odolbeau/sflive2014-workers
Swarrot https://github.com/swarrot/swarrot
None