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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Olivier Dolbeau
April 07, 2014
Programming
3.7k
6
Share
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
More Decks by Olivier Dolbeau
See All by Olivier Dolbeau
Throw new \Exception(); Oui, mais laquelle ?
odolbeau
1
300
Jane & Webby
odolbeau
0
490
Translating a monolingual application
odolbeau
2
690
DX: Developer eXperience
odolbeau
1
130
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
670
Other Decks in Programming
See All in Programming
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
380
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
120
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
710
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
1.3k
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
1.1k
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
110
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
740
Back to the roots of date
jinroq
0
490
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
160
The Less-Told Story of Socket Timeouts
coe401_
3
660
AI-DLC Deep Dive
yuukiyo
9
4.8k
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
430
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
290
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
160
Information Architects: The Missing Link in Design Systems
soysaucechin
0
900
Docker and Python
trallard
47
3.8k
Design in an AI World
tapps
1
200
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
150
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Bash Introduction
62gerente
615
210k
A better future with KSS
kneath
240
18k
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