SlideShare a Scribd company logo
1 of 40
Download to read offline
ØM Q &
SERVIC ES
ØM Q &
SERVIC ES
  part i: zeromq
wtf is zmq?
“ Zeromq is what bsd
  sockets may have
  looked like, if they
  were designed today.”
Zeromq is a
communication
library.
polyglot
# C & C++
void *context = zmq_init(1);
# ruby
context = ZMQ::Context.new(1)
# php
$context = new ZMQContext(1);
# etc.
atomic
         & finite
aging patte rns
m ess
request/reply

             blah?
    client           server
             blah!
request/reply
    client
                server
    client

    client
                server
    client
request/reply
    client
                server
    client

    client
                server
    client
request/reply
    client
                server
    client

    client
                server
    client
push/pull

            blah!
   pusher           puller
push/pull
 STEP 1   STEP 2   STEP 3

            node

 node       node
                   node
 node       node

            node
push/pull
 STEP 1   STEP 2   STEP 3

            node

 node       node
                   node
 node       node

            node
push/pull
 STEP 1   STEP 2   STEP 3

            node

 node       node
                   node
 node       node

            node
pub/sub
                subscriber

                subscriber
    publisher
                subscriber

                subscriber
pub/sub
                subscriber

                subscriber
    publisher
                subscriber

                subscriber
pub/sub
                subscriber

                subscriber
    publisher
                subscriber

                subscriber
node
irl                                       node


client         REQ
                     server               node
                                PUS
             USH                    H
         P



worker        PUSH
                     worker   PUB
                                        subscriber
                              PUB




 node                 node              subscriber
examples
a chat service
            chat server




  kenneth      sean       mark
a chat service
                         chat server

            pub                    pub   pub

                  push




  kenneth                   sean               mark
a chat service
            chat server




    hi!
  kenneth      sean       mark
a chat service
            chat server




    hi!
  kenneth       hi!
               sean        hi!
                          mark
a chat service
# create the context                                      server.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
pub = context.socket(ZMQ::PUB)
pull = context.socket(ZMQ::PULL)

# bind the sockets
pub.bind('tcp://*:1338')
pull.bind('tcp://*:1337')

# wait for input, and forward to all subscribers
while body = pull.recv
  payload = JSON.parse(body)
  pub.send "#{payload['user']}> #{payload['message'].cyan}"
end
a chat service
# create the context                                      server.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
pub = context.socket(ZMQ::PUB)
pull = context.socket(ZMQ::PULL)

# bind the sockets
pub.bind('tcp://*:1338')
pull.bind('tcp://*:1337')

# wait for input, and forward to all subscribers
while body = pull.recv
  payload = JSON.parse(body)
  pub.send "#{payload['user']}> #{payload['message'].cyan}"
end
a chat service
# create the context                                      server.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
pub = context.socket(ZMQ::PUB)
pull = context.socket(ZMQ::PULL)

# bind the sockets
pub.bind('tcp://*:1338')
pull.bind('tcp://*:1337')

# wait for input, and forward to all subscribers
while body = pull.recv
  payload = JSON.parse(body)
  pub.send "#{payload['user']}> #{payload['message'].cyan}"
end
a chat service
# create the context                                      server.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
pub = context.socket(ZMQ::PUB)
pull = context.socket(ZMQ::PULL)

# bind the sockets
pub.bind('tcp://*:1338')
pull.bind('tcp://*:1337')

# wait for input, and forward to all subscribers
while body = pull.recv
  payload = JSON.parse(body)
  pub.send "#{payload['user']}> #{payload['message'].cyan}"
end
a chat service
# create the context                                      server.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
pub = context.socket(ZMQ::PUB)
pull = context.socket(ZMQ::PULL)

# bind the sockets
pub.bind('tcp://*:1338')
pull.bind('tcp://*:1337')

# wait for input, and forward to all subscribers
while body = pull.recv
  payload = JSON.parse(body)
  pub.send "#{payload['user']}> #{payload['message'].cyan}"
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
a chat service
# create the context                                      client.rb
context = ZMQ::Context.new(1)

# create the two sockets we need
sub = context.socket(ZMQ::SUB)
sub.setsockopt(ZMQ::SUBSCRIBE, '')
push = context.socket(ZMQ::PUSH)

# bind the sockets
sub.connect("tcp://#{server}:1338")
push.connect("tcp://#{server}:1337")

# wait for some input
while line = gets.chomp
  push.send(line) unless line == ''
  # dump buffered messages
  puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK))
end
demo
$ git clone https://github.com/ 
  ChartBoost/zmq-examples.git
$ bundle install
$ ruby chat/client.rb
demo
$ git clone https://github.com/ 
  ChartBoost/zmq-examples.git
$ bundle install
$ ruby chat/client.rb
thanks
@KOB — KENNETH@CHARTBOOST.COM

More Related Content

What's hot

Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09Ilya Grigorik
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)Flor Ian
 
692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded wsmile790243
 
How to run multiple instances of transmission daemon in linux debian or ubuntu
How to run multiple instances of transmission daemon in linux debian or ubuntuHow to run multiple instances of transmission daemon in linux debian or ubuntu
How to run multiple instances of transmission daemon in linux debian or ubuntuAditya Gusti Tammam
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch어형 이
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件wensheng wei
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networkingallingeek
 

What's hot (11)

Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)
 
692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w
 
Docker networking
Docker networkingDocker networking
Docker networking
 
Curl
CurlCurl
Curl
 
How to run multiple instances of transmission daemon in linux debian or ubuntu
How to run multiple instances of transmission daemon in linux debian or ubuntuHow to run multiple instances of transmission daemon in linux debian or ubuntu
How to run multiple instances of transmission daemon in linux debian or ubuntu
 
Java sockets
Java socketsJava sockets
Java sockets
 
Socket programming
Socket programmingSocket programming
Socket programming
 
debugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitchdebugging openstack neutron /w openvswitch
debugging openstack neutron /w openvswitch
 
解读server.xml文件
解读server.xml文件解读server.xml文件
解读server.xml文件
 
Single Host Docker Networking
Single Host Docker NetworkingSingle Host Docker Networking
Single Host Docker Networking
 

Viewers also liked

Design Patterns : Solution to Software Design Problems
Design Patterns : Solution to Software Design ProblemsDesign Patterns : Solution to Software Design Problems
Design Patterns : Solution to Software Design ProblemsEdureka!
 
Build reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQBuild reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQRobin Xiao
 
The Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's ClassThe Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's Classdesertturtle
 
Basic tutorial how to use slideshare
Basic tutorial how to use slideshareBasic tutorial how to use slideshare
Basic tutorial how to use slideshareCherrylin Ramos
 
Stages of problem solving presentation
Stages of problem solving presentationStages of problem solving presentation
Stages of problem solving presentationbbaugh
 
How to Teach Yourself to Code
How to Teach Yourself to CodeHow to Teach Yourself to Code
How to Teach Yourself to CodeMattan Griffel
 
Introduction to Slide Design: 7 Rules for Creating Effective Slides
Introduction to Slide Design: 7 Rules for Creating Effective SlidesIntroduction to Slide Design: 7 Rules for Creating Effective Slides
Introduction to Slide Design: 7 Rules for Creating Effective SlidesAlex Rister
 
Tweet Tweet Tweet Twitter
Tweet Tweet Tweet TwitterTweet Tweet Tweet Twitter
Tweet Tweet Tweet TwitterJimmy Jay
 
16 things that Panhandlers can teach us about Content Marketing
16 things that Panhandlers can teach us about Content Marketing16 things that Panhandlers can teach us about Content Marketing
16 things that Panhandlers can teach us about Content MarketingBrad Farris
 
Cubicle Ninjas' Code of Honor
Cubicle Ninjas' Code of HonorCubicle Ninjas' Code of Honor
Cubicle Ninjas' Code of HonorCubicle Ninjas
 
Hashtag 101 - All You Need to Know About Hashtags
Hashtag 101 - All You Need to Know About HashtagsHashtag 101 - All You Need to Know About Hashtags
Hashtag 101 - All You Need to Know About HashtagsModicum
 
The Do's and Don'ts of Presentations
The Do's and Don'ts of Presentations The Do's and Don'ts of Presentations
The Do's and Don'ts of Presentations Cubicle Ninjas
 
Using Color to Convey Data in Charts
Using Color to Convey Data in ChartsUsing Color to Convey Data in Charts
Using Color to Convey Data in ChartsZingChart
 
The no bullet bullet slide
The no bullet bullet slideThe no bullet bullet slide
The no bullet bullet slideGavin McMahon
 
Amazing First Slide Picture Templates
Amazing First Slide Picture Templates Amazing First Slide Picture Templates
Amazing First Slide Picture Templates Abhishek Shah
 
Weekly Inspirational Quotes by Fun Team Building
Weekly Inspirational Quotes by Fun Team BuildingWeekly Inspirational Quotes by Fun Team Building
Weekly Inspirational Quotes by Fun Team BuildingFun Team Building
 
Preparing to fail
Preparing to failPreparing to fail
Preparing to failaweyenberg
 
Effective Use of Icons & Images
Effective Use of Icons & ImagesEffective Use of Icons & Images
Effective Use of Icons & ImagesUIEpreviews
 
FontShop - Typography
FontShop - TypographyFontShop - Typography
FontShop - TypographyPoppy Young
 

Viewers also liked (20)

Design Patterns : Solution to Software Design Problems
Design Patterns : Solution to Software Design ProblemsDesign Patterns : Solution to Software Design Problems
Design Patterns : Solution to Software Design Problems
 
Build reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQBuild reliable, traceable, distributed systems with ZeroMQ
Build reliable, traceable, distributed systems with ZeroMQ
 
The Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's ClassThe Important Book by Mrs. Henson's Class
The Important Book by Mrs. Henson's Class
 
Basic tutorial how to use slideshare
Basic tutorial how to use slideshareBasic tutorial how to use slideshare
Basic tutorial how to use slideshare
 
Stages of problem solving presentation
Stages of problem solving presentationStages of problem solving presentation
Stages of problem solving presentation
 
How to Teach Yourself to Code
How to Teach Yourself to CodeHow to Teach Yourself to Code
How to Teach Yourself to Code
 
Introduction to Slide Design: 7 Rules for Creating Effective Slides
Introduction to Slide Design: 7 Rules for Creating Effective SlidesIntroduction to Slide Design: 7 Rules for Creating Effective Slides
Introduction to Slide Design: 7 Rules for Creating Effective Slides
 
Tweet Tweet Tweet Twitter
Tweet Tweet Tweet TwitterTweet Tweet Tweet Twitter
Tweet Tweet Tweet Twitter
 
16 things that Panhandlers can teach us about Content Marketing
16 things that Panhandlers can teach us about Content Marketing16 things that Panhandlers can teach us about Content Marketing
16 things that Panhandlers can teach us about Content Marketing
 
Cubicle Ninjas' Code of Honor
Cubicle Ninjas' Code of HonorCubicle Ninjas' Code of Honor
Cubicle Ninjas' Code of Honor
 
Email and tomorrow
Email and tomorrowEmail and tomorrow
Email and tomorrow
 
Hashtag 101 - All You Need to Know About Hashtags
Hashtag 101 - All You Need to Know About HashtagsHashtag 101 - All You Need to Know About Hashtags
Hashtag 101 - All You Need to Know About Hashtags
 
The Do's and Don'ts of Presentations
The Do's and Don'ts of Presentations The Do's and Don'ts of Presentations
The Do's and Don'ts of Presentations
 
Using Color to Convey Data in Charts
Using Color to Convey Data in ChartsUsing Color to Convey Data in Charts
Using Color to Convey Data in Charts
 
The no bullet bullet slide
The no bullet bullet slideThe no bullet bullet slide
The no bullet bullet slide
 
Amazing First Slide Picture Templates
Amazing First Slide Picture Templates Amazing First Slide Picture Templates
Amazing First Slide Picture Templates
 
Weekly Inspirational Quotes by Fun Team Building
Weekly Inspirational Quotes by Fun Team BuildingWeekly Inspirational Quotes by Fun Team Building
Weekly Inspirational Quotes by Fun Team Building
 
Preparing to fail
Preparing to failPreparing to fail
Preparing to fail
 
Effective Use of Icons & Images
Effective Use of Icons & ImagesEffective Use of Icons & Images
Effective Use of Icons & Images
 
FontShop - Typography
FontShop - TypographyFontShop - Typography
FontShop - Typography
 

Similar to Ømq & Services @ Chartboost

ZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 LabsZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 LabsJames Dennis
 
Zmq in context of openstack
Zmq in context of openstackZmq in context of openstack
Zmq in context of openstackYatin Kumbhare
 
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Using Node.js to  Build Great  Streaming Services - HTML5 Dev ConfUsing Node.js to  Build Great  Streaming Services - HTML5 Dev Conf
Using Node.js to Build Great Streaming Services - HTML5 Dev ConfTom Croucher
 
Deep dive in container service discovery
Deep dive in container service discoveryDeep dive in container service discovery
Deep dive in container service discoveryDocker, Inc.
 
Message Queueing - by an MQ noob
Message Queueing - by an MQ noobMessage Queueing - by an MQ noob
Message Queueing - by an MQ noobRichard Jones
 
Lindsay distributed geventzmq
Lindsay distributed geventzmqLindsay distributed geventzmq
Lindsay distributed geventzmqRobin Xiao
 
FreeBSD, ipfw and OpenVPN 2.1 server
FreeBSD, ipfw and OpenVPN 2.1 serverFreeBSD, ipfw and OpenVPN 2.1 server
FreeBSD, ipfw and OpenVPN 2.1 serverTomaz Muraus
 
DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...
DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...
DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...NetProtocol Xpert
 
Running Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docx
Running Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docxRunning Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docx
Running Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docxcowinhelen
 
Servers with Event Machine - David Troy - RailsConf 2011
Servers with Event Machine - David Troy - RailsConf 2011Servers with Event Machine - David Troy - RailsConf 2011
Servers with Event Machine - David Troy - RailsConf 2011David Troy
 
In depth understanding network security
In depth understanding network securityIn depth understanding network security
In depth understanding network securityThanawan Tuamyim
 
ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!Pedro Januário
 
Netcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beemaNetcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beemaRaghunath G
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network TroubleshootingOpen Source Consulting
 

Similar to Ømq & Services @ Chartboost (20)

ZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 LabsZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 Labs
 
Zmq in context of openstack
Zmq in context of openstackZmq in context of openstack
Zmq in context of openstack
 
Message queueing
Message queueingMessage queueing
Message queueing
 
NS2 (1).docx
NS2 (1).docxNS2 (1).docx
NS2 (1).docx
 
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Using Node.js to  Build Great  Streaming Services - HTML5 Dev ConfUsing Node.js to  Build Great  Streaming Services - HTML5 Dev Conf
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
 
Deep dive in container service discovery
Deep dive in container service discoveryDeep dive in container service discovery
Deep dive in container service discovery
 
Message Queueing - by an MQ noob
Message Queueing - by an MQ noobMessage Queueing - by an MQ noob
Message Queueing - by an MQ noob
 
Lindsay distributed geventzmq
Lindsay distributed geventzmqLindsay distributed geventzmq
Lindsay distributed geventzmq
 
FreeBSD, ipfw and OpenVPN 2.1 server
FreeBSD, ipfw and OpenVPN 2.1 serverFreeBSD, ipfw and OpenVPN 2.1 server
FreeBSD, ipfw and OpenVPN 2.1 server
 
DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...
DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...
DMVPN configuration - Configuring Cisco dynamic Multipoint VPN - HUB, SPOKES,...
 
Running Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docx
Running Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docxRunning Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docx
Running Head IMPLEMENTING THE LIST AND SEARCH FEATURES IN THE DIS.docx
 
201904 websocket
201904 websocket201904 websocket
201904 websocket
 
Client server
Client serverClient server
Client server
 
Servers with Event Machine - David Troy - RailsConf 2011
Servers with Event Machine - David Troy - RailsConf 2011Servers with Event Machine - David Troy - RailsConf 2011
Servers with Event Machine - David Troy - RailsConf 2011
 
In depth understanding network security
In depth understanding network securityIn depth understanding network security
In depth understanding network security
 
ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!
 
Router commands
Router commandsRouter commands
Router commands
 
Netcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beemaNetcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beema
 
Netcat - 101 Swiss Army Knife
Netcat - 101 Swiss Army KnifeNetcat - 101 Swiss Army Knife
Netcat - 101 Swiss Army Knife
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 

Recently uploaded

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Ømq & Services @ Chartboost

  • 2. ØM Q & SERVIC ES part i: zeromq
  • 4. “ Zeromq is what bsd sockets may have looked like, if they were designed today.”
  • 6. polyglot # C & C++ void *context = zmq_init(1); # ruby context = ZMQ::Context.new(1) # php $context = new ZMQContext(1); # etc.
  • 7. atomic & finite
  • 9. request/reply blah? client server blah!
  • 10. request/reply client server client client server client
  • 11. request/reply client server client client server client
  • 12. request/reply client server client client server client
  • 13. push/pull blah! pusher puller
  • 14. push/pull STEP 1 STEP 2 STEP 3 node node node node node node node
  • 15. push/pull STEP 1 STEP 2 STEP 3 node node node node node node node
  • 16. push/pull STEP 1 STEP 2 STEP 3 node node node node node node node
  • 17. pub/sub subscriber subscriber publisher subscriber subscriber
  • 18. pub/sub subscriber subscriber publisher subscriber subscriber
  • 19. pub/sub subscriber subscriber publisher subscriber subscriber
  • 20. node irl node client REQ server node PUS USH H P worker PUSH worker PUB subscriber PUB node node subscriber
  • 22. a chat service chat server kenneth sean mark
  • 23. a chat service chat server pub pub pub push kenneth sean mark
  • 24. a chat service chat server hi! kenneth sean mark
  • 25. a chat service chat server hi! kenneth hi! sean hi! mark
  • 26. a chat service # create the context server.rb context = ZMQ::Context.new(1) # create the two sockets we need pub = context.socket(ZMQ::PUB) pull = context.socket(ZMQ::PULL) # bind the sockets pub.bind('tcp://*:1338') pull.bind('tcp://*:1337') # wait for input, and forward to all subscribers while body = pull.recv payload = JSON.parse(body) pub.send "#{payload['user']}> #{payload['message'].cyan}" end
  • 27. a chat service # create the context server.rb context = ZMQ::Context.new(1) # create the two sockets we need pub = context.socket(ZMQ::PUB) pull = context.socket(ZMQ::PULL) # bind the sockets pub.bind('tcp://*:1338') pull.bind('tcp://*:1337') # wait for input, and forward to all subscribers while body = pull.recv payload = JSON.parse(body) pub.send "#{payload['user']}> #{payload['message'].cyan}" end
  • 28. a chat service # create the context server.rb context = ZMQ::Context.new(1) # create the two sockets we need pub = context.socket(ZMQ::PUB) pull = context.socket(ZMQ::PULL) # bind the sockets pub.bind('tcp://*:1338') pull.bind('tcp://*:1337') # wait for input, and forward to all subscribers while body = pull.recv payload = JSON.parse(body) pub.send "#{payload['user']}> #{payload['message'].cyan}" end
  • 29. a chat service # create the context server.rb context = ZMQ::Context.new(1) # create the two sockets we need pub = context.socket(ZMQ::PUB) pull = context.socket(ZMQ::PULL) # bind the sockets pub.bind('tcp://*:1338') pull.bind('tcp://*:1337') # wait for input, and forward to all subscribers while body = pull.recv payload = JSON.parse(body) pub.send "#{payload['user']}> #{payload['message'].cyan}" end
  • 30. a chat service # create the context server.rb context = ZMQ::Context.new(1) # create the two sockets we need pub = context.socket(ZMQ::PUB) pull = context.socket(ZMQ::PULL) # bind the sockets pub.bind('tcp://*:1338') pull.bind('tcp://*:1337') # wait for input, and forward to all subscribers while body = pull.recv payload = JSON.parse(body) pub.send "#{payload['user']}> #{payload['message'].cyan}" end
  • 31. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 32. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 33. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 34. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 35. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 36. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 37. a chat service # create the context client.rb context = ZMQ::Context.new(1) # create the two sockets we need sub = context.socket(ZMQ::SUB) sub.setsockopt(ZMQ::SUBSCRIBE, '') push = context.socket(ZMQ::PUSH) # bind the sockets sub.connect("tcp://#{server}:1338") push.connect("tcp://#{server}:1337") # wait for some input while line = gets.chomp push.send(line) unless line == '' # dump buffered messages puts buffered_msg while (buffered_msg = sub.recv(ZMQ::NOBLOCK)) end
  • 38. demo $ git clone https://github.com/ ChartBoost/zmq-examples.git $ bundle install $ ruby chat/client.rb
  • 39. demo $ git clone https://github.com/ ChartBoost/zmq-examples.git $ bundle install $ ruby chat/client.rb

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n