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
Disque
Search
Mariano Iglesias
May 30, 2015
Programming
0
90
Disque
Lightning talk given at New York for CakeFest 2015
Mariano Iglesias
May 30, 2015
Tweet
Share
More Decks by Mariano Iglesias
See All by Mariano Iglesias
Simple is Good, Complex is Bad
mariano
2
150
A future without frameworks
mariano
2
190
Procesando pagos: LO ESTÁS HACIENDO MAL
mariano
0
200
Go aka Golang
mariano
1
100
ElasticSearch: hacer un Google es una papa
mariano
0
68
Random tips that will save your project's life
mariano
0
40
node-db: La excusa perfecta para hablar de C++ y Node.js
mariano
0
67
Episodio VI - El retorno del freelancer
mariano
0
30
Going crazy with NodeJS and CakePHP
mariano
1
61
Other Decks in Programming
See All in Programming
cmp.Or に感動した
otakakot
3
230
Jakarta EE meets AI
ivargrimstad
0
190
Vapor Revolution
kazupon
1
170
初めてDefinitelyTypedにPRを出した話
syumai
0
420
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
1k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
C++でシェーダを書く
fadis
6
4.1k
Better Code Design in PHP
afilina
PRO
0
130
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
210
Remix on Hono on Cloudflare Workers
yusukebe
1
300
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
180
Realtime API 入門
riofujimon
0
150
Featured
See All Featured
Done Done
chrislema
181
16k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Being A Developer After 40
akosma
87
590k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Embracing the Ebb and Flow
colly
84
4.5k
How to Ace a Technical Interview
jacobian
276
23k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Writing Fast Ruby
sferik
627
61k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
The Invisible Side of Design
smashingmag
298
50k
Transcript
Disque A job queue to win it all
#DoingItWrong
Using Redis as a queue? No longer needed
• Non-blocking server • Distributed • Replication • In memory
• Job acknolwedging • If not acknolwedged, goes back to
queue • Job retries • Job delay
#Run
$ disque /etc/disque/7711.conf $ disque /etc/disque/7712.conf $ disque -p 7711
127.0.0.1:7711> cluster meet 127.0.0.1 7712 OK 127.0.0.1:7711> HELLO 1) (integer) 1 2) "26a390eb07bba018a9ed0591b2110479f16bb19d" 3) 1) "26a390eb07bba018a9ed0591b2110479f16bb19d" 2) "127.0.0.1" 3) "7711" 4) "1" 4) 1) "9ccaa86ceaf032eeb67097d639b80315090f79d5" 2) "127.0.0.1" 3) "7712" 4) "1"
#PHP
github.com/mariano/disque-php $ composer install mariano/disque-php
$disque = new \Disque\Client([ '127.0.0.1:7111', '127.0.0.2:7112' ]); $job = new
\App\Jobs\EmailJob([ 'email' => '
[email protected]
', 'template' => 'signed_up' ]); $disque->queue('emails')->push($job); $job = new \App\Jobs\RemindActivation($user); $disque->queue('emails')->schedule($job, new \DateTime('+1 week'));
$queue = $disque->queue('emails'); while ($job = $queue->pull()) { $job->execute(); $queue->processed($job);
}
#CLIGotchas
• Memory! • Error recovery • SIGINT • supervisord