Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
250
Jane & Webby
odolbeau
0
440
Translating a monolingual application
odolbeau
2
620
DX: Developer eXperience
odolbeau
1
100
DX: Developer eXperience
odolbeau
1
550
EasyAdminBundle introduction
odolbeau
0
190
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
570
Other Decks in Programming
See All in Programming
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
5
1.9k
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
170
Go コードベースの構成と AI コンテキスト定義
andpad
0
110
20 years of Symfony, what's next?
fabpot
2
340
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.2k
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
290
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
1k
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
160
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
370
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
380
Integrating WordPress and Symfony
alexandresalome
0
140
開発に寄りそう自動テストの実現
goyoki
1
740
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.1k
Music & Morning Musume
bryan
46
7k
Building Applications with DynamoDB
mza
96
6.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Code Review Best Practice
trishagee
74
19k
Balancing Empowerment & Direction
lara
5
790
KATA
mclloyd
PRO
32
15k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Practical Orchestrator
shlominoach
190
11k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Raft: Consensus for Rubyists
vanstee
141
7.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
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