SlideShare a Scribd company logo
!"#$%
    &'()*
   +',-(.-


!/'001.2*34-()
51.**678)',9*:1,(4,(
51.*:)-(
51.*;17.*-66/':-('1,
%4:),'<748
= >?>@*61//',9*A:-//B-:C*61//',9D
   =   E-.94*/-(4,:;*AHI*84:1,2*61//JD

= >?>@*E1,9F61//',9
   =   G1.C8*&'()*AK18(D*8(-,2-.2*3%%L*AM-:CN*4(:D

= 5/-8)*81:C4(8*-,2*G4B81:C4(8
   =   E1&*/-(4,:;N*/1&*1O4.)4-28

   =   M4<7'.48*,1,F3%%L*A,1,FM-:CD*84.O4.
M-:C*>LP
= :-//A4,OD
 !*Q*8(-(78N*)4-24.8N*B12;*R
= 4-:)*:-//*1,/;*:1,(-',8*-*8',9/4*M4<748(
= B12;*:-,*B4*-,*$,7K4.-B/4*A01.*K7/('F6-.(D
= 84.O4.*:-,*784*S446F>/'O4N*4(:
= T1(*:1K6-('B/4*&'()*&4B81:C4(8*1.*
  5/-8)*81:C4(8
= ++E*:18(8*64.F.4<748(
Client 1             Server             Client 2
Page Load
                         Poll


                                             Poll
User Event
                        Request




                         Resp               Async


                                             Poll


                                                                User Event

                                           Request




                        Async               Resp



                          Poll




                                           Timeout


                                            Poll
E1,9*61//',9*2'8-2O-,(-948
= +4.O4.*C4468*61//*.4<748(8*U1,*)1/2V
= W,0.'4,2/;*(1*)4-O;F().4-242*84.O4.8
 = >6-:)4N*K1,9.4/N*4(:
= G1.C8*,':4/;*1,*4O4,(42*+4.O4.8
 = %)',*A&'()*-8;,:X8',-(.-D
= T1(*9112*01.*8)-.42*)18(',9*1.*34.1C7
= #7/('F(-B*6.1B/4K
%)4*Y-;47Z*6.1(1:1/
= [11*517,2-('1,]8*!"#$%[*6.14:(
  =   )((6^__8O,`:1K4(2`:1K_(.7,C_B-;47Z_B-;47Z`)(K/

= L7B/'8)_87B8:.'B4*1,*U!)-,,4/8V
= Y.1&84.8*/'K'(*6-.-//4/*:1,,4:('1,8*64.*
  21K-',```*',:/72',9*-:.188*K7/('6/4*(-B8N*
  7,01.(7,-(4/;

= >(*K18(*(&1*?+"T*@3M*:1,,4:('1,8*64.*:/'4,(
  =   ",4*(1*/1,9F61//*A.4:4'O4*-8;,:).1,178*K488-948D

  =   ",4*(1*84,2*.4<748(8
Y-;47Z*K488-948
= 3-,28)-C4
= !1,,4:(_['8:1,,4:(
= +7B8:.'B4_W,87B8:.'B4
 = U!)-,,4/8V*)-O4*6-()42*,-K48
= L7B/'8)
= >7()4,(':-('1,*'8*4Z:/7242*A/-;4.42*1,*(16D
= U>2O':4V*8-;8*)1&*(1*61//*-,2*)1&*10(4,
<74.;`:1K4(`8
<script src="jquery.comet.js"></script>
<script src="json2.js”></script>
<script type="application/javascript">
  $.comet.connect(location.origin+"/cometd");
  $.comet.subscribe("/chat/demo", function(msg) {...});
  $.comet.publish("/chat/demo", {
       user: username,
       join: true,
       chat: username + " has joined"
     });
</script>

ALSO:
• startBatch(), endBatch()
• unsubscribe(channel), disconnect()
B-;47ZF.-:C*94K
a*94K*',8(-//*B-;47ZF.-:C
a*:-(*:1,0'9`.7
require ‘bayeux’

class ChatServer < Bayeux
  configure { set :public, File.dirname(__FILE__) }
  get '/' { erb :index }
  def deliver msg
    channel = msg['channel']
    publish :data => msg['data'], :channel => channel
    { :successful => true, :channel => channel
      :clientId => msg['clientId'],:id => msg['id']
    }
  end
end

run ChatServer.new
",*9'()7B^

= )((68^__9'()7B`:1K_:)4-()_<74.;`:1K4(
 = !1,(-',8*()4*?-O-8:.'6(*>LP*01.*Y-;47Z
= )((68^__9'()7B`:1K_:)4-()_B-;47ZF.-:C
 = !1,(-',8*-*+',-(.-*B-84*:/-88
+(-(78
= W848*&4-C*!/'4,(P2]8*A6.1O'24*;17.*1&,D
= T1*('K417(*01.*24-2*:/'4,(8
= T1*24(4:('1,*10*K7/('6/4F(-B8
= T1*-7(1F.4,491('-(4*-0(4.*84.O4.*.48(-.(
= T1*84.O4.F','('-(42*('K417(*10*/1,9*61//8
= #-,7-//;*(48(42*F*)-.2*(1*-7(1K-(4b
Questions?


     !/'001.2`34-()c9K-'/`:1K
                    -O-'/-B/4*01.*)'.4

More Related Content

DOCX
Data_moving_script
PDF
Connecting Pebble to the World
ODP
Web Scraping
PDF
OSC2007-niigata - mashup
PPTX
21.search in laravel
PPTX
Phpbase
PDF
1時間で作るマッシュアップサービス(関西版)
Data_moving_script
Connecting Pebble to the World
Web Scraping
OSC2007-niigata - mashup
21.search in laravel
Phpbase
1時間で作るマッシュアップサービス(関西版)

What's hot (7)

PDF
Ass.crane op compentence 1(1)
PDF
Angular.js + Rails at WeWork or: The Accidental Feature
PPTX
Elixir flow: Building and tuning concurrent workflows
PDF
Desymfony 2011 - Habemus Bundles
PDF
Nomethoderror talk
PDF
20191116 custom operators in swift
Ass.crane op compentence 1(1)
Angular.js + Rails at WeWork or: The Accidental Feature
Elixir flow: Building and tuning concurrent workflows
Desymfony 2011 - Habemus Bundles
Nomethoderror talk
20191116 custom operators in swift
Ad

Viewers also liked (20)

PPTX
Sirbingleyreport
PDF
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
PDF
Language Edupreneurship
PPTX
Wiki: Open Collaborative Learning Environment
PDF
Oslobodimo Hardware
PPTX
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
PPT
The Great Highland Bagpipe
PPT
What Is Powerpoint
PDF
Post-relational databases: What's wrong with web development? v3
PPT
Denk- en discussiedag sept 2010: digitale collectie
PPTX
Poaching LG15: ARG-style
PDF
Social Media & Web 2.0 Services for Choirs
PDF
Mojo Facets – so, you have data and browser?
PPTX
Re-Negotiating Narrative: Emergent Storytelling
PPTX
Spectacular Subcultures: From luz to hacktivism
PDF
Post-relational databases: What's wrong with web development?
PDF
The Constellation Query Language
PDF
Open Education in Virtual Worlds
PPTX
IAZ2013 - Gopress voor openbare bibliotheken
PDF
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Sirbingleyreport
Information Literacy and Smart Life-Long Learning: Knowledge Antidotes in the...
Language Edupreneurship
Wiki: Open Collaborative Learning Environment
Oslobodimo Hardware
Operation Payback (...is a bitch): Hacktivism at the Dawn of Copyright Contro...
The Great Highland Bagpipe
What Is Powerpoint
Post-relational databases: What's wrong with web development? v3
Denk- en discussiedag sept 2010: digitale collectie
Poaching LG15: ARG-style
Social Media & Web 2.0 Services for Choirs
Mojo Facets – so, you have data and browser?
Re-Negotiating Narrative: Emergent Storytelling
Spectacular Subcultures: From luz to hacktivism
Post-relational databases: What's wrong with web development?
The Constellation Query Language
Open Education in Virtual Worlds
IAZ2013 - Gopress voor openbare bibliotheken
Slobodni softver za digitalne arhive: EPrints u Knjižnici Filozofskog fakulte...
Ad

Recently uploaded (20)

PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
A Presentation on Touch Screen Technology
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
project resource management chapter-09.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Approach and Philosophy of On baking technology
PPTX
1. Introduction to Computer Programming.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Hindi spoken digit analysis for native and non-native speakers
A comparative study of natural language inference in Swahili using monolingua...
A Presentation on Touch Screen Technology
Univ-Connecticut-ChatGPT-Presentaion.pdf
DP Operators-handbook-extract for the Mautical Institute
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Encapsulation theory and applications.pdf
TLE Review Electricity (Electricity).pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
project resource management chapter-09.pdf
A comparative analysis of optical character recognition models for extracting...
Assigned Numbers - 2025 - Bluetooth® Document
Approach and Philosophy of On baking technology
1. Introduction to Computer Programming.pptx
Unlocking AI with Model Context Protocol (MCP)
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Encapsulation_ Review paper, used for researhc scholars
SOPHOS-XG Firewall Administrator PPT.pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf

Comet with Sinatra