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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
310
Jane & Webby
odolbeau
0
500
Translating a monolingual application
odolbeau
2
690
DX: Developer eXperience
odolbeau
1
130
DX: Developer eXperience
odolbeau
1
580
EasyAdminBundle introduction
odolbeau
0
240
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
670
Other Decks in Programming
See All in Programming
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.1k
さぁV100、メモリをお食べ・・・
nilpe
0
130
OSもどきOS
arkw
0
460
ふつうのFeature Flag実践入門
irof
7
3.6k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
190
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
440
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
300
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.4k
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
240
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
230
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.1k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
130
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Deep Space Network (abreviated)
tonyrice
0
160
Leo the Paperboy
mayatellez
7
1.8k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
420
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
240
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