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.6k
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
290
Translating a monolingual application
odolbeau
2
390
DX: Developer eXperience
odolbeau
0
50
DX: Developer eXperience
odolbeau
0
390
EasyAdminBundle introduction
odolbeau
0
130
REX API Platform
odolbeau
0
1k
Features flags at BlaBlaCar
odolbeau
4
830
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
1
390
Be gentle with your prod!
odolbeau
1
600
Other Decks in Programming
See All in Programming
戦略的DDDは重いのか? / Is strategic DDD heavy?
pictiny
3
2.1k
Dev ContainersとTestcontainers
bells17
3
100
Using "modern" Ruby to build a better, faster Homebrew
mikemcquaid
2
280
TypeScriptのパフォーマンス改善
yajihum
14
5.1k
Direct Style Effect Systems The Print[A] ExampleA Comprehension Aid
philipschwarz
PRO
0
410
The Design of Everyday APIs - PyCon 2024
roguelynn
1
200
一文字エイリアスのすすめ
fujimura
0
200
The World is a Network (and We Are Just Nodes)
whatyouhide
0
100
Revisiting the Hotwire Landscape after Turbo 8 @ RailsConf 2024, Detroit
marcoroth
3
610
Next.js App Router
quramy
14
2.3k
An adventure of Happy Eyeballs
coe401_
1
240
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
1
130
Featured
See All Featured
A Philosophy of Restraint
colly
197
16k
Building Adaptive Systems
keathley
32
1.9k
The Art of Programming - Codeland 2020
erikaheidi
43
12k
Statistics for Hackers
jakevdp
790
220k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
47k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
67
14k
Product Roadmaps are Hard
iamctodd
45
9.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Designing with Data
zakiwarfel
96
4.8k
Fireside Chat
paigeccino
22
2.7k
Why Our Code Smells
bkeepers
PRO
331
56k
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