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
220
Jane & Webby
odolbeau
0
390
Translating a monolingual application
odolbeau
2
560
DX: Developer eXperience
odolbeau
1
92
DX: Developer eXperience
odolbeau
1
540
EasyAdminBundle introduction
odolbeau
0
180
REX API Platform
odolbeau
0
1.3k
Features flags at BlaBlaCar
odolbeau
5
1.1k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
500
Other Decks in Programming
See All in Programming
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
4
1.2k
AIともっと楽するE2Eテスト
myohei
8
3k
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
290
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
930
Python型ヒント完全ガイド 初心者でも分かる、現代的で実践的な使い方
mickey_kubo
1
230
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
290
レトロゲームから学ぶ通信技術の歴史
kimkim0106
0
100
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
260
テスト駆動Kaggle
isax1015
1
530
DMMを支える決済基盤の技術的負債にどう立ち向かうか / Addressing Technical Debt in Payment Infrastructure
yoshiyoshifujii
3
220
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
1.1k
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
220
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Why Our Code Smells
bkeepers
PRO
337
57k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
700
The Invisible Side of Design
smashingmag
301
51k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
We Have a Design System, Now What?
morganepeng
53
7.7k
4 Signs Your Business is Dying
shpigford
184
22k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
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