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
820
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
1
380
Be gentle with your prod!
odolbeau
1
590
Other Decks in Programming
See All in Programming
元気予報
suu_mire0726
0
850
Designing for tomorrow's programming workflows
honnibal
PRO
2
110
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
270
try! Swift Tokyo 初参加報告LT
hinakko2
0
190
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
360
Elm Form Validation
bkuhlmann
0
500
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
320
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
0
110
What We Can Learn From OSS
inouehi
0
400
try! Swift Tokyo 2024のLT枠に採択されたプロポーザルを出すときに考えていたこと
ski
0
340
OpenTelemetry のサービスという概念について
azukiazusa1
2
1.1k
本格ローグライク制作にEbitengineを選んでみた
nagainaganawa
0
290
Featured
See All Featured
Web Components: a chance to create the future
zenorocha
304
41k
Product Roadmaps are Hard
iamctodd
43
9.7k
Building Your Own Lightsaber
phodgson
97
5.7k
Building Applications with DynamoDB
mza
88
5.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.5k
How to Ace a Technical Interview
jacobian
272
22k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Six Lessons from altMBA
skipperchong
19
3k
The Cost Of JavaScript in 2023
addyosmani
13
3.8k
Debugging Ruby Performance
tmm1
69
11k
Ruby is Unlike a Banana
tanoku
95
10k
The Mythical Team-Month
searls
214
42k
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