SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

Rhodes And Phone Gap
Rhodes And Phone GapRhodes And Phone Gap
Rhodes And Phone GapMakoto Inoue
 
Tribus do frio norte
Tribus do frio norteTribus do frio norte
Tribus do frio norteoclubdasideas
 
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 pedraoclubdasideas
 
Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2Makoto Inoue
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigiMakoto 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 losJosé L. López S.
 
交大校慶演出 導演真礙眼 新聞稿
交大校慶演出 導演真礙眼 新聞稿交大校慶演出 導演真礙眼 新聞稿
交大校慶演出 導演真礙眼 新聞稿Mike Lu
 
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/Marketingpmtidaho
 
交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢Mike Lu
 
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/Marketingpmtidaho
 
交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢交大北區校友會-房地產發展趨勢
交大北區校友會-房地產發展趨勢Mike Lu
 
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 queridaoclubdasideas
 
Tantas cousas que dicirte
Tantas cousas que dicirteTantas cousas que dicirte
Tantas cousas que dicirteoclubdasideas
 
Carta do xefe indio Seattle
Carta do xefe indio SeattleCarta do xefe indio Seattle
Carta do xefe indio Seattleoclubdasideas
 
Os dez mandamentos verdes
Os dez mandamentos verdesOs dez mandamentos verdes
Os dez mandamentos verdesoclubdasideas
 

Andere mochten auch (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
 

Mehr von Makoto Inoue

Video learningtech
Video learningtechVideo learningtech
Video learningtechMakoto Inoue
 
Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Makoto Inoue
 
Data viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueData viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueMakoto Inoue
 
Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Makoto Inoue
 

Mehr von 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
 

Kürzlich hochgeladen

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Kürzlich hochgeladen (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Building realtimewebslide