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
6
3.6k
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
Tweet
Share
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
280
Jane & Webby
odolbeau
0
460
Translating a monolingual application
odolbeau
2
670
DX: Developer eXperience
odolbeau
1
110
DX: Developer eXperience
odolbeau
1
570
EasyAdminBundle introduction
odolbeau
0
200
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
640
Other Decks in Programming
See All in Programming
AgentCoreとHuman in the Loop
har1101
5
220
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
970
組織で育むオブザーバビリティ
ryota_hnk
0
170
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
Implementation Patterns
denyspoltorak
0
280
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
100
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
ぼくの開発環境2026
yuzneri
0
100
Featured
See All Featured
Designing for Timeless Needs
cassininazir
0
130
Code Review Best Practice
trishagee
74
20k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
130
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
A Tale of Four Properties
chriscoyier
162
24k
Visualization
eitanlees
150
17k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Game over? The fight for quality and originality in the time of robots
wayneb77
1
110
The Art of Programming - Codeland 2020
erikaheidi
57
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
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