Polyglot

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

 Polyglot

How To Write A Web App in 6 Programming Languages

Sau Sheong Chang

October 10, 2014

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

21 slides
  1. Polyglot Or  How  To  Write  A  Web  App  in  6

      Programming  Languages Chang  Sau  Sheong   Oct  2014 1
  2. Acceptor HTTP Responder Responder Responder POST/_/post Responder Responder Responder GET/_/posts

    Acceptor HTTP Acceptor HTTP Broker ZMQ ZMQ Responder Responder Responder GET/_/post/new 9
  3. Simple  responder require 'securerandom' require 'bundler' Bundler.require broker = "tcp://localhost:4321"

    routeid = "GET/_/hello/ruby" identity = SecureRandom.uuid puts "#{routeid} - #{identity} responder ready." ctx = ZMQ::Context.new client = ctx.socket ZMQ::REQ client.identity = identity client.connect broker client.send_string routeid loop do request = String.new client.recv_string request response = [routeid, "200", "{\"Content-Type\": \"text/html\"}", "Hello World"] client.send_strings response end Define  route  ID  and  unique   responder  identity Connect  to  broker Register  responder Receive  request  and  process   it Return  with  response 13

More Decks by Sau Sheong Chang

Other Decks in Technology