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
12
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
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
150
Jane & Webby
odolbeau
0
350
Translating a monolingual application
odolbeau
2
500
DX: Developer eXperience
odolbeau
1
67
DX: Developer eXperience
odolbeau
1
510
EasyAdminBundle introduction
odolbeau
0
160
REX API Platform
odolbeau
0
1.2k
Features flags at BlaBlaCar
odolbeau
5
990
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
460
Other Decks in Programming
See All in Programming
Rails アプリ地図考 Flush Cut
makicamel
1
120
Honoとフロントエンドの 型安全性について
yodaka
7
1.2k
チームリードになって変わったこと
isaka1022
0
200
Introduction to kotlinx.rpc
arawn
0
700
SwiftUI Viewの責務分離
elmetal
PRO
1
240
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
120
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
900
Linux && Docker 研修/Linux && Docker training
forrep
24
4.5k
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.3k
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
6
4k
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
340
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
320
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
How GitHub (no longer) Works
holman
314
140k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
For a Future-Friendly Web
brad_frost
176
9.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
RailsConf 2023
tenderlove
29
1k
How to train your dragon (web standard)
notwaldorf
91
5.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
The Invisible Side of Design
smashingmag
299
50k
BBQ
matthewcrist
87
9.5k
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