Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Making asynchronous tasks in PHP
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
350
Jane & Webby
odolbeau
0
530
Translating a monolingual application
odolbeau
2
710
DX: Developer eXperience
odolbeau
1
140
DX: Developer eXperience
odolbeau
1
590
EasyAdminBundle introduction
odolbeau
0
270
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
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
7
5.1k
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
220
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
170
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
270
The Rails Doctrine Decade
koic
2
410
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
220
スマート反転とウェブアクセシビリティ
camiha
0
220
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
290
速習iPhone Duo対応
yuukiw00w
2
870
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
590
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
420
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
330
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
240
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
510
エンジニアに許された特別な時間の終わり
watany
109
250k
Believing is Seeing
oripsolob
1
230
The Invisible Side of Design
smashingmag
301
52k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
910
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
350
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
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