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
Asynchronous tasks in PHP
Search
Olivier Dolbeau
June 24, 2014
Programming
13
1.7k
Asynchronous tasks in PHP
Why & how making asynchronous tasks in PHP
PHPTour Lyon 2014 - 24/06/2014
Olivier Dolbeau
June 24, 2014
Tweet
Share
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Jane & Webby
odolbeau
0
310
Translating a monolingual application
odolbeau
2
450
DX: Developer eXperience
odolbeau
0
54
DX: Developer eXperience
odolbeau
0
430
EasyAdminBundle introduction
odolbeau
0
140
REX API Platform
odolbeau
0
1.1k
Features flags at BlaBlaCar
odolbeau
4
900
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
1
420
Be gentle with your prod!
odolbeau
1
650
Other Decks in Programming
See All in Programming
労務ドメインを快適に開発する方法 / How to Comfortably Develop in the Labor Domain
yuki21
1
250
Hono・Prisma・AWSでGeoなAPI開発
nokonoko1203
5
670
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
Ruby Parser progress report 2024
yui_knk
2
220
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
590
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
180
Rustではじめる負荷試験
skanehira
5
1.2k
GraphQL あるいは React における自律的なデータ取得について
quramy
11
2.9k
状態管理ライブラリZustandの導入から運用まで
k1tikurisu
3
460
What we keep in mind when migrating from Serverless Framework to AWS CDK and AWS SAM
kasacchiful
1
140
月間4.5億回再生を超える大規模サービス TVer iOSアプリのリアーキテクチャ戦略 - iOSDC2024
techtver
PRO
1
810
dRuby 入門者によるあなたの身近にあるdRuby 入門
makicamel
4
350
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
48
4.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.3k
Clear Off the Table
cherdarchuk
91
320k
Web development in the modern age
philhawksworth
204
10k
Speed Design
sergeychernyshev
22
430
Facilitating Awesome Meetings
lara
49
5.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
263
13k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
326
21k
The Cost Of JavaScript in 2023
addyosmani
42
5.3k
Large-scale JavaScript Application Architecture
addyosmani
508
110k
YesSQL, Process and Tooling at Scale
rocio
167
14k
How GitHub Uses GitHub to Build GitHub
holman
472
290k
Transcript
Making asynchronous tasks in PHP
None
Olivier Dolbeau @odolbeau Web Architect About me
RIDESHARING Cost of motoring 100€ 25€ 25€ 25€ 25€ @BlaBlaCar_FR
ALONE
A fast growing community
A European phenomenon
None
None
None
None
None
Your visitors don’t want to wait! and if they have
to, they don’t want to know it
For you :
Your web servers want to make their job! (they don’t
care about emails other boring tasks)
None
Separating concerns Serveur web Consumer Consumer Consumer Consumer Consumer
Separating concerns
None
How Rabbit work?
With more consumers
You can add simple routing logic
Or more complex logic
How your app talks to RabbitMQ?
With the PECL extension Thanks to Pieter de Zwart See:
pdezwart/php-amqp Use librabbitmq (alanxz/rabbitmq-c)
How to connect to RabbitMQ?
How to publish a message?
How to consume a message?
None
None
None
None
It’s a trap !
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
Wait 30 seconds and retry!
Wait 3 minutes and retry!
Wait half an hour and retry!
None
None
None
None
Swarrot
Existing processors
None
None
None
Last tip !
None
None
Making asynchronous tasks is good (even in PHP)
@odolbeau https://joind.in/ 11237 https://github.com/swarrot/swarrot https://speakerdeck.com/odolbeau/asynchronous-tasks-in-php