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.6k
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
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
230
Jane & Webby
odolbeau
0
400
Translating a monolingual application
odolbeau
2
570
DX: Developer eXperience
odolbeau
1
97
DX: Developer eXperience
odolbeau
1
540
EasyAdminBundle introduction
odolbeau
0
180
REX API Platform
odolbeau
0
1.3k
Features flags at BlaBlaCar
odolbeau
5
1.1k
25+ million members in 22 countries, how to scale with Symfony2
odolbeau
2
510
Other Decks in Programming
See All in Programming
TDD 実践ミニトーク
contour_gara
1
260
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
3
1.8k
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
220
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
0
210
兎に角、コードレビュー
mitohato14
0
160
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
210
コンテキストエンジニアリング Cursor編
kinopeee
1
730
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
350
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
200
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
230
AIでLINEスタンプを作ってみた
eycjur
1
220
Featured
See All Featured
Done Done
chrislema
185
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.5k
Facilitating Awesome Meetings
lara
55
6.5k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Side Projects
sachag
455
43k
How STYLIGHT went responsive
nonsquared
100
5.8k
The Cult of Friendly URLs
andyhume
79
6.6k
RailsConf 2023
tenderlove
30
1.2k
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