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
Making asynchronous tasks in PHP
Search
Olivier Dolbeau
April 07, 2014
Programming
6
3.5k
Making asynchronous tasks in PHP
Why & how making asynchronous tasks in PHP
SFLIve2014 - 04/07/2014 with Grégoire Pineau
Olivier Dolbeau
April 07, 2014
Tweet
Share
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Jane & Webby
odolbeau
0
310
Translating a monolingual application
odolbeau
2
450
DX: Developer eXperience
odolbeau
0
54
DX: Developer eXperience
odolbeau
0
440
EasyAdminBundle introduction
odolbeau
0
150
REX API Platform
odolbeau
0
1.1k
Features flags at BlaBlaCar
odolbeau
4
900
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
1
420
Be gentle with your prod!
odolbeau
1
650
Other Decks in Programming
See All in Programming
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.5k
なぜアジャイルがうまくいかないのか?
yum3
1
110
LangChainの現在とv0.3にむけて
os1ma
4
940
Prompt Cachingは本当に効果的なのか検証してみた.pdf
ttnyt8701
0
540
あなたのアプリ、ログはでてますか?あるいはログをだしてますか? (Funabashi.dev用 軽量版)
uzulla
2
130
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
690
Modernisation Progressive d’Applications PHP
hhamon
0
110
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
220
GraphQLとGigaViewer for Apps
numeroanddev
2
190
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
540
Swiftコードバトル必勝法
toshi0383
0
170
What is Parser
yui_knk
9
4.2k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
30
2.3k
BBQ
matthewcrist
83
9.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
48
2.8k
How to name files
jennybc
75
98k
The World Runs on Bad Software
bkeepers
PRO
64
11k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
663
120k
Writing Fast Ruby
sferik
623
60k
Docker and Python
trallard
39
3k
The Pragmatic Product Professional
lauravandoore
31
6.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
26
3.9k
Transcript
Making asynchronous tasks in PHP The easy way
Olivier Dolbeau Dev @odolbeau Who ? Grégoire Pineau Dev @lyrixx
Summary • Why? • How? • Problems? Solutions! • Tips
None
None
None
None
None
None
Your visitors don’t want to wait! (and if they have
to, they don’t want to know it) First reason to do asynchronous
Your web servers want to make their job! (they don’t
care about emails other boring tasks) Second reason to do asynchronous
None
Separating concerns Serveur web Consumer Consumer Consumer Consumer Consumer
None
How Rabbit work?
With more consumers
You can add simple routing logic
Or more complex logic
None
How your app talks to RabbitMQ?
With the PECL extension Thanks to Pieter de Zwart See:
pdezwart/php-amqp Use librabbitmq (alanxz/rabbitmq-c)
With videlalvaro/php-amqplib
None
</troll>
How to connect to RabbitMQ?
How to publish a message?
How to consume a message?
None
None
None
None
None
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
None
None
None
Wait 30 seconds and retry!
Wait 3 minutes and retry!
Wait half an hour and retry!
None
None
None
None
None
None
<troll>
None
None
None
You can take a look at the code ! https://github.com/odolbeau/sflive2014-workers
Swarrot https://github.com/swarrot/swarrot
None