$30 off During Our Annual Pro Sale. View Details »
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.8k
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
250
Jane & Webby
odolbeau
0
440
Translating a monolingual application
odolbeau
2
620
DX: Developer eXperience
odolbeau
1
100
DX: Developer eXperience
odolbeau
1
550
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
570
Other Decks in Programming
See All in Programming
AI時代もSEOを頑張っている話
shirahama_x
0
260
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
300
俺流レスポンシブコーディング 2025
tak_dcxi
13
8.2k
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
150
GeistFabrik and AI-augmented software development
adewale
PRO
0
280
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
12
7k
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
6.7k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
5
1.9k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
290
Level up your Gemini CLI - D&D Style!
palladius
1
180
dnx で実行できるコマンド、作ってみました
tomohisa
0
140
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
110
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
57k
The Invisible Side of Design
smashingmag
302
51k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Done Done
chrislema
186
16k
Docker and Python
trallard
46
3.7k
Visualization
eitanlees
150
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
For a Future-Friendly Web
brad_frost
180
10k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
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