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
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
330
Jane & Webby
odolbeau
0
510
Translating a monolingual application
odolbeau
2
690
DX: Developer eXperience
odolbeau
1
130
DX: Developer eXperience
odolbeau
1
580
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
680
Other Decks in Programming
See All in Programming
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
230
Built Our Own Background Agent at LayerX #aidevex_findy
layerx
PRO
9
3.8k
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
440
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
230
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
200
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
560
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
280
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
710
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
0
120
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
440
Foundation Models frameworkで画像分析
ryodeveloper
1
160
数百円から始めるRuby電子工作
tarosay
0
120
Featured
See All Featured
Between Models and Reality
mayunak
4
380
Exploring anti-patterns in Rails
aemeredith
3
450
The Curse of the Amulet
leimatthew05
2
13k
The SEO Collaboration Effect
kristinabergwall1
1
510
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.2k
Documentation Writing (for coders)
carmenintech
77
5.4k
Believing is Seeing
oripsolob
1
170
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
620
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
How to Ace a Technical Interview
jacobian
281
24k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
230
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
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