Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ZMQ on Node.js
Search
Casear Chu
May 29, 2013
Programming
330
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ZMQ on Node.js
Casear Chu
May 29, 2013
More Decks by Casear Chu
See All by Casear Chu
Collie 編輯 Animation Editor
casear
0
43
Hadoop on Node.js
casear
2
150
Other Decks in Programming
See All in Programming
APNsからLive Activityを開始する話
yumnumm
0
170
Workers Cache を知る
syumai
0
360
sbt 2.0: takeoff
eed3si9n
0
160
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
370
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
460
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
30 Presentation Tips
portentint
PRO
1
430
We Are The Robots
honzajavorek
0
400
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
410
Agile that works and the tools we love
rasmusluckow
331
22k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
890
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
•Windows • node.js should be 32bit • install zmq •
install VS2010 C++ express • install Windows SDK 7.1 • install python <3.0.0 • npm install zmq •Mac • brew install zmq • npm install zmq ping 192.168.0.190 13年5月29⽇日星期三
進擊的ZMQ on Node.js 13年5月29⽇日星期三
Mac • brew install libzmq • npm install zmq 13年5月29⽇日星期三
About Me me = name:Casear Chu, email: “
[email protected]
” company:”Chuto(迌)” blog:
“http://casear.chuto.tw” IsMarried:true hasChild:true projects:null interests:[“web” “maker” “others”] faith:”have fun and change the world” picture:”/9j/ 4AAQSkZJRgABAQEAYABgAAD/ 13年5月29⽇日星期三
迌 《康熙字典》「⼻彳」注引《說⽂文》:⼩小步也,象⼈人脛三屬相連也。 引《集韻》:⼻彳亍,⾜足之步也。 引潘岳〈射雉賦〉:⼻彳亍中輟。〔註〕徐爰⽈曰:⼻彳亍,⽌止貌。張銑⽈曰:⾏行貌,中少留也。 其中引《說⽂文》⼩小步的意思,就是慢慢⾛走,引申為「 遊玩 」的意思。 衍⽣生意思: 流氓 ⾐衣⻝⾷食無缺,⼜又沒⼈人會管你管很緊,可以充分做⾃自⼰己想做的事
13年5月29⽇日星期三
真不好玩 那你還做 每天加班 有夠雖⼩小 ⼝口號治國 13年5月29⽇日星期三
We are looking for Front-end Developer Arduino Raspberry Pi embedded
Hadoop big data We play anything for fun 3D Printer 13年5月29⽇日星期三
Fix the World 13年5月29⽇日星期三
13年5月29⽇日星期三
我們今天是講Node.js 13年5月29⽇日星期三
I/O? Background or? Dynamic component? Deliver immediately? message queues? Slow
Componet? Different network transport? language? architectures? network errors? 重試? 忽略? 放棄? Load Balance? Reliable? Fair Queue? crashes? Reconnect? Problems? 13年5月29⽇日星期三
懼 13年5月29⽇日星期三
13年5月29⽇日星期三
哭 13年5月29⽇日星期三
練 13年5月29⽇日星期三
ØMQ Is Not a Neutral Carrier 13年5月29⽇日星期三
One IO thread for all socket 13年5月29⽇日星期三
bind connect send subscribe 13年5月29⽇日星期三
組隊打怪 13年5月29⽇日星期三
Req-Res 13年5月29⽇日星期三
13年5月29⽇日星期三
var zmq = require(‘zmq’) var req = zmq.socket(‘req’) req.connect(‘tcp://XXX:XX’) req.on(‘message’,function(data){
console.log(data.toString()) }) req.send(‘Hello’) req,send(‘hello2’) 13年5月29⽇日星期三
var zmq = require(‘zmq’) var rep = zmq.socket(‘rep’) req.bind(‘tcp://XXX:XX’,function(err) {
rep.on(‘message’,function(data){ console.log(data.toString()) rep.send(data*2) } ) 13年5月29⽇日星期三
Pub-Sub 13年5月29⽇日星期三
13年5月29⽇日星期三
Push-Pull 13年5月29⽇日星期三
13年5月29⽇日星期三
Pair Socket 13年5月29⽇日星期三
13年5月29⽇日星期三
Note • Frame is length+content • Req-Res is blocking •
IPC not work on Windows 13年5月29⽇日星期三
Exclusive Pair 13年5月29⽇日星期三
戰 13年5月29⽇日星期三
Shared Queue 13年5月29⽇日星期三
Fair Queuing 13年5月29⽇日星期三
Parallel Pipeline with Kill Signaling 13年5月29⽇日星期三
13年5月29⽇日星期三
PAIR Sockets 13年5月29⽇日星期三
13年5月29⽇日星期三
• 我有很多個Workers • 我有很多個Publishers • 我的Worker跟Publisher隨時會死掉 • 我怎麼確保所有的Subscriber都到⿑齊了 • Queues滿了怎麼辦?
13年5月29⽇日星期三
嫩 13年5月29⽇日星期三
ZMQ_HWM ZMQ_HWM http://api.zeromq.org/2-1:zmq-setsockopt 13年5月29⽇日星期三
Broker? 13年5月29⽇日星期三
Req 有什麼問題? 13年5月29⽇日星期三
Rep 有什麼問題? 13年5月29⽇日星期三
The Asynchronous Client/Server Pattern 13年5月29⽇日星期三
13年5月29⽇日星期三
Request Broker 13年5月29⽇日星期三
13年5月29⽇日星期三
Pub-Sub Proxy 13年5月29⽇日星期三
The Dynamic Discovery Problem 13年5月29⽇日星期三
13年5月29⽇日星期三
Transport Bridging 13年5月29⽇日星期三
13年5月29⽇日星期三
Pub-Sub Synchronization 13年5月29⽇日星期三
13年5月29⽇日星期三
Problem handling 13年5月29⽇日星期三
13年5月29⽇日星期三
再 戰 13年5月29⽇日星期三
• 我的Worker掛了該怎麼辦 • 網路斷線了我該怎麼處理 • 我怎麼確保訊息的 Reliability 13年5月29⽇日星期三
crash slowly for its input out of memory Message queues
can overflow slow clients Networks can fail Hardware can fail 13年5月29⽇日星期三
Reliability 13年5月29⽇日星期三
還 是 嫩 13年5月29⽇日星期三
Advanced Request- Reply Patterns 13年5月29⽇日星期三
哭 13年5月29⽇日星期三
13年5月29⽇日星期三
Heartbeat 13年5月29⽇日星期三
Shrugging It Off disconnect and reconnect -< cause memory leak
keep alive good slient or bad slient 13年5月29⽇日星期三
One-Way Heartbeat send large amounts of data, as heartbeats will
be delayed 13年5月29⽇日星期三
Ping-Pong Heartbeat 13年5月29⽇日星期三
Lazy Pirate Pattern 13年5月29⽇日星期三
13年5月29⽇日星期三
Simple Pirate Pattern 13年5月29⽇日星期三
13年5月29⽇日星期三
Paranoid Pirate Pattern http://rfc.zeromq.org/spec:6 13年5月29⽇日星期三
13年5月29⽇日星期三
Majordomo Pattern http://rfc.zeromq.org/spec:7 http://rfc.zeromq.org/spec:8 13年5月29⽇日星期三
13年5月29⽇日星期三
Titanic pattern 13年5月29⽇日星期三
13年5月29⽇日星期三
Binary Star pattern 13年5月29⽇日星期三
13年5月29⽇日星期三
Freelance pattern 13年5月29⽇日星期三
13年5月29⽇日星期三
結束了嗎? 13年5月29⽇日星期三
Advanced Publish- Subscribe Patterns 13年5月29⽇日星期三
贛 13年5月29⽇日星期三
Miss messages because join late Subscriber fetch slow , queues
overflow Network Slow, queues overflow 13年5月29⽇日星期三
Espresso Pattern (Monitor Network) 13年5月29⽇日星期三
Suicidal Snail Pattern (Handle too slow sub) 13年5月29⽇日星期三
Black Box Pattern (High speed sub) 13年5月29⽇日星期三