SlideShare una empresa de Scribd logo
1 de 54
Descargar para leer sin conexión
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
rows = database.fetch(category = 'news')
                 template = read_file('homepage.html')
                 json = fetc_url('http://.../')



                  database.fetch(category = 'news', callback)
                  read_file('homepage.html', callback)
                  fetc_url('http://.../', callback)




Friday, 27 August 2010
Friday, 27 August 2010
Benefits
                         1. Less overhead
                         1. Not releasing connection = good to share state within a session




Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
var ws = new WebSocket("ws://example.com/service");
                         ws.onopen = function() {
                            ws.send("message to send");
                         };
                         ws.onmessage = function (evt) {
                          var received_msg = evt.data;
                         };
                         ws.onclose = function() {};




Friday, 27 August 2010
var httpServer = http.createServer(serveFile);
                         var server = ws.createServer({}, httpServer);

                         server.addListener("connection", function(conn){
                           conn.send(conn.id, "Connected as: "+conn.id);

                           conn.addListener("message", function(message){
                             conn.broadcast(message);
                           });
                         });

                         server.addListener("close", function(conn){
                           conn.broadcast("<"+conn.id+"> disconnected");
                         });

                         server.listen(8000);

                                           http://github.com/miksago/node-websocket-ser ver/blob/master/examples/echo-ser ver.js


                            node-websocket-ser ver = Micheil Smith


Friday, 27 August 2010
http://blog.new-bamboo.co.uk/2009/12/14/pushing-the-boundary-of-real-time-web-with-t witter-and-xfactor



Friday, 27 August 2010
By Hiroshi Ichikawa




                         Remy Sharp just made iPhone PhoneGap version for 75
                         (remy)




Friday, 27 August 2010
Matz and Ryan Dahli




Friday, 27 August 2010
Matz and Ryan Dahli




Friday, 27 August 2010
require 'em-websocket'

    EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080) do |ws|
      ws.onopen    { ws.send "Hello Client!"}
      ws.onmessage { |msg| ws.send "Pong: #{msg}" }
      ws.onclose   { puts "WebSocket closed" }
    end




                                 em-websocket = Illya Grigorik




Friday, 27 August 2010
rev-websocket = sadayuki furuhashi
      cramp = Pratik Naik
      rainbows - sunshowers = Eric Wong
      em-websocket-proxy = Matt Colyer
      web-socket-ruby = Hiroshi Ichikawa




Friday, 27 August 2010
(Alex MacCaw’s fork has 76 support for Cramp)




Friday, 27 August 2010
http://bit.ly/9tKdeK

                                      http://github.com/makoto/wsbench

       This is example of using 2 small size ec2 instance, making 5000 ~ 20000 number of connections , send 1 message to distribute to all
       connections, and majored the average of how long it took to be delivered to each connection (DRAFT 75 ONLY)



Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
http://eiga.com/movie/44107/goods/t142030853/




Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
IMPORTANT : You can synchronise data from
                         client to ser ver by saving before hitting Pusher




Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
http://screenr.com/NJ0



Friday, 27 August 2010
Friday, 27 August 2010
server = new Pusher(Pusher.key, Pusher.channel);

        server.bind('note-create', function(note) {
          generateNote(note);
        });



        post '/notes.json' do
          content_type 'text/json', :charset => 'utf-8'
          n = Note.new(params[:note])
          n.save
          Pusher[CHANNEL].trigger('note-create', n.to_json)
        end
                         We enhanced WebSocket by adding channel and event




Friday, 27 August 2010
http://www.flickr.com/photos/amy_ng/1692424006/sizes/m/


Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
Friday, 27 August 2010
http://screenr.com/B5O




Friday, 27 August 2010
Friday, 27 August 2010
class PusherController < ApplicationController
        def     auth
          response = Pusher[params[:channel_name]].authenticate(params[:socket_id], {
                :user_id => current_user.id,
                :user_info => {
                  :name => current_user.username
                }
             })
          render :json => response
        else
          render :text => "Not authorized", :status => '403'
        end
      end
    end

                           http://github.com/makoto/rubykaigi/tree/presence




Friday, 27 August 2010
jQuery(function(){
        var server = new Pusher('#{Pusher.key}');
        var myPresenceChannel = server.subscribe('presence#{pusher_presense_channel}')

          myPresenceChannel.bind('pusher:subscription_succeeded', function(member_list){
             updatePresence(member_list);
          })

          myPresenceChannel.bind('pusher:member_added', function(member){
             updatePresence(myPresenceChannel.members());
          })

        myPresenceChannel.bind('pusher:member_removed', function(member){
           updatePresence(myPresenceChannel.members());
        })
      });
                            http://github.com/makoto/rubykaigi/tree/presence




Friday, 27 August 2010
Friday, 27 August 2010
@connections = {} # How do you scale beyond one process?
               EM.run {
                 EM::WebSocket.start(:host => "0.0.0.0",:port =>3001)do|ws|
                      ws.onopen {
                        puts "WebSocket connection open"
                        @connections[ws.id] = ws
                      }
                      ws.onclose { @connections.delete(ws.id)}
                      ws.onmessage { |data|
                        @connections.each do |k, v|
                          v.send(data) unless v.id == ws.id
                        end
                      }
                 end
               }




Friday, 27 August 2010
CC
                                  WS   API
                              C



                         CC
                                  WS   API
                              C



                         CC
                                  WS   API
                              C




Friday, 27 August 2010
http://www.infoq.com/articles/Web-Sockets-Proxy-Ser vers

Friday, 27 August 2010
Friday, 27 August 2010
http://naun.blog118.fc2.com/




Friday, 27 August 2010

Más contenido relacionado

Destacado

Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2
Makoto Inoue
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigi
Makoto Inoue
 
Askeland phulenotes ch21printable propiedades termicas de los
Askeland phulenotes ch21printable propiedades termicas de losAskeland phulenotes ch21printable propiedades termicas de los
Askeland phulenotes ch21printable propiedades termicas de los
José L. López S.
 
Brian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/MarketingBrian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/Marketing
pmtidaho
 
Brian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/MarketingBrian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/Marketing
pmtidaho
 

Destacado (20)

Rhodes And Phone Gap
Rhodes And Phone GapRhodes And Phone Gap
Rhodes And Phone Gap
 
Tribus do frio norte
Tribus do frio norteTribus do frio norte
Tribus do frio norte
 
Maria Mariño
Maria MariñoMaria Mariño
Maria Mariño
 
Entre o si e o non
Entre o si e o nonEntre o si e o non
Entre o si e o non
 
Primeiro foi o mar, despois a pedra
Primeiro foi o mar, despois a pedraPrimeiro foi o mar, despois a pedra
Primeiro foi o mar, despois a pedra
 
Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2
 
euruko
eurukoeuruko
euruko
 
Memento Homo
Memento HomoMemento Homo
Memento Homo
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigi
 
Askeland phulenotes ch21printable propiedades termicas de los
Askeland phulenotes ch21printable propiedades termicas de losAskeland phulenotes ch21printable propiedades termicas de los
Askeland phulenotes ch21printable propiedades termicas de los
 
交大校慶演出 導演真礙眼 新聞稿
交大校慶演出 導演真礙眼 新聞稿交大校慶演出 導演真礙眼 新聞稿
交大校慶演出 導演真礙眼 新聞稿
 
Brian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/MarketingBrian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/Marketing
 
Sinsai devnest
Sinsai devnestSinsai devnest
Sinsai devnest
 
交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢
 
Brian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/MarketingBrian McManus Speech NTCA 2008 PR/Marketing
Brian McManus Speech NTCA 2008 PR/Marketing
 
交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢
 
Que hermosa te deu Dios, terra querida
Que hermosa te deu Dios, terra queridaQue hermosa te deu Dios, terra querida
Que hermosa te deu Dios, terra querida
 
Tantas cousas que dicirte
Tantas cousas que dicirteTantas cousas que dicirte
Tantas cousas que dicirte
 
Carta do xefe indio Seattle
Carta do xefe indio SeattleCarta do xefe indio Seattle
Carta do xefe indio Seattle
 
Os dez mandamentos verdes
Os dez mandamentos verdesOs dez mandamentos verdes
Os dez mandamentos verdes
 

Más de Makoto Inoue (7)

Video learningtech
Video learningtechVideo learningtech
Video learningtech
 
StepUpYouTuber
StepUpYouTuberStepUpYouTuber
StepUpYouTuber
 
StepUp 4pt5
StepUp 4pt5StepUp 4pt5
StepUp 4pt5
 
Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7
 
Data viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueData viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoue
 
Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1
 
Ruby and japanese
Ruby and japaneseRuby and japanese
Ruby and japanese
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Building realtimewebslide