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
1.9k
12
Share
Asynchronous tasks in PHP
Why & how making asynchronous tasks in PHP
PHPTour Lyon 2014 - 24/06/2014
Olivier Dolbeau
June 24, 2014
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
300
Jane & Webby
odolbeau
0
480
Translating a monolingual application
odolbeau
2
680
DX: Developer eXperience
odolbeau
1
120
DX: Developer eXperience
odolbeau
1
580
EasyAdminBundle introduction
odolbeau
0
220
REX API Platform
odolbeau
0
1.4k
Features flags at BlaBlaCar
odolbeau
5
1.2k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
660
Other Decks in Programming
See All in Programming
アーキテクチャモダナイゼーションとは何か
nwiizo
3
500
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
300
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
3
2.3k
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
690
ファインチューニングせずメインコンペを解く方法
pokutuna
0
260
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
120
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
AI活用のコスパを最大化する方法
ochtum
0
370
事業会社でのセキュリティ長期インターンについて
masachikaura
0
220
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
180
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.3k
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Facilitating Awesome Meetings
lara
57
6.8k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
160
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The Invisible Side of Design
smashingmag
302
51k
The Limits of Empathy - UXLibs8
cassininazir
1
280
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Prompt Engineering for Job Search
mfonobong
0
250
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
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