SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Comet: Making The Web a 2-Way Medium
            Joe Walker, DWR Lead Developer
What is Comet?




Long lived HTTP connections
 •Low latency data
 •For events outside the browser
Agenda:



Use Cases

Techniques

Technologies

Demos
Why?




Ajax made individual pages interactive places to explore

More and more of the data on the web is social and
therefore changing
Why?

               Time people
               spend on a
                  page



                 Time before
                    a page
                   changes



       Evolution of the Web
Why?




Simply keeping a page up to date is easy: poll

But polling kills servers

Comet keeps pages up to date *efficiently*
But ...




It’s a hack - the web is biased against it
Does that stop us?




Ajax is also a hack, but that hasn’t stopped it

And Comet does work
Examples of Comet

Chat is everywhere: GMail, Meebo, Yahoo Mail, etc.
GMail uses it to update email conversations
Google Docs uses it to show you other collaborators actions
yes.com uses it to track radio station playlists
Polar Rose are using it for delayed photo recognition
GPokr is using it for online gaming
etc...
Agenda:



Use Cases

Techniques

Technologies

Demos
Client Tricks

Maximum of 2 connections per browser per host
 •Coordination using window.name in the client
 •or cookies using a server
 •or use multi-home DNS

HTTP streaming is download only (chunked mode)

TCP connections are kept alive under HTTP 1.1

Server detection of failed connections
Client How-to: Forever Frame

Client posts an iframe which doesn’t close quickly
 •Send text/plain and poll in browser (not IE)
 •Send text/plain with 4k whitespace to flush IE
 •Flush with a <script> tag for each data block

The iframe will need killing and restarting to avoid memory
leak

But IE clicks when iframe starts
Client How-to: Long Polling


Client makes an XHR request which does not return
immediately

IE disallows reading XHR.responseText until connection is
closed

Although you can keep XHR frames open forever, generally
you poll
Client How-to: htmlfile


‘htmlfile’ is an ActiveX control like XHR:
 htmlfile = new ActiveXObject(quot;htmlfilequot;);
 htmlfile.open();
 htmlfile.write(quot;<html><iframe src='javascript:void(0)'
     onload='cleanup();'></iframe></html>quot;);
 htmlfile.close();
 htmlfile.parentWindow.dwr = dwr;


Avoids ‘clicking’, but doesn’t work in IE/Server 2003

Not supported in Firefox, Safari, Opera, etc.
Client How-to: Callback Polling




Create <script> blocks pointing to any domain

Create new script block when last completes
Client How-to: Other Options


Mime Messaging:
 •Uses Multipart Mime in HTML: x-multipart-replace
 •Not in IE
 •Excellent performance

Flash
  •We probably have enough other options that we don’t
    need to get into plugins
Server Tricks



Watch out for stream-stoppers
 •Apache: mod_jk
 •Buggy network proxies
 •Various application firewalls

Watch out for thread starvation
Agenda:



Use Cases

Techniques

Technologies

Demos
Saving you the Pain

On the Server:
 •Jetty, Twisted Python, Grizzly, Lighttpd, Perbal

Event Buses
  •Cometd, mod_pubsub, mod_repubsub, Lightstreamer,
   KnowHow, HAppS

Frameworks
  •DWR, Juggernaut, Nevow
Bayeux




Standard Protocol for Interoperable Comet

Supported by:
 •Cometd, Jetty, Dojo, DWR and servers in development
   from BEA, IBM and Sun
Bayeux on the Client via Cometd




Dojo client implementation:
dojox.cometd.init(serverUrl);
dojox.cometd.publish(quot;/topicquot;, {/* payload */});
dojox.cometd.subscribe(quot;/topicquot;, function(){/* ... */ });
Bayeux on the Server


package dojox.cometd;

public interface Bayeux
{
  Client newClient(String idprefix, Listener listener);

    void publish(Client fromClient, String toChannel,
                 Object data, String msgId);

    void subscribe(String toChannel, Client subscriber);

    ...
}
DWR




      Reverse Ajax == Comet + Polling + Piggyback
             (It’s just a configuration option)

 Allowing the server to easily manage groups of users
DWR, Reverse Ajax




DWR calling remote Javascript
Collection sessions = context.getScriptSessionsByPage(url);

ScriptProxy proxy = new ScriptProxy(sessions);
proxy.addFunctionCall(quot;updateCallersquot;, calls);
DWR, Reverse Ajax




DWR calling remote Script.aculo.us
Collection sessions = context.getScriptSessionsByPage(url);

Effect e = new Effect(sessions);
e.fade(quot;client-idquot;);
DWR, Reverse Ajax



DWR calling remote TIBCO GI
Collection sessions = context.getScriptSessionsByPage(url);

Server server = GI.getServer(sessions, quot;appnamequot;);
Button button = server.getJSXById(quot;buttonquot;, Button.class);
button.setEnabled(Form.STATEDISABLED, true);
Bayeux Performance
Agenda:



Use Cases

Techniques

Technologies

Demos
Demo


       http://www.webtide.com/sessionRater/
Demo
Questions?
http://cometdaily.com/   http://getahead.org/blog/joe/
http://cometd.com/       http://directwebremoting.org/

Weitere ähnliche Inhalte

Was ist angesagt?

Going Live! with Comet
Going Live! with CometGoing Live! with Comet
Going Live! with CometSimon Willison
 
WebSockets On Fire
WebSockets On FireWebSockets On Fire
WebSockets On FireJef Claes
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets PresentationVolodymyr Lavrynovych
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeFastly
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopFastly
 
wa-cometjava-pdf
wa-cometjava-pdfwa-cometjava-pdf
wa-cometjava-pdfHiroshi Ono
 
HTML5 WebSocket Introduction
HTML5 WebSocket IntroductionHTML5 WebSocket Introduction
HTML5 WebSocket IntroductionMarcelo Jabali
 
Avatar Maven
Avatar MavenAvatar Maven
Avatar Mavenjlorenzen
 
Systems Introspection
Systems IntrospectionSystems Introspection
Systems IntrospectionAndrew Howden
 
TLS - 2016 Velocity Training
TLS - 2016 Velocity TrainingTLS - 2016 Velocity Training
TLS - 2016 Velocity TrainingPatrick Meenan
 
Building a scalable online backup system in python
Building a scalable online backup system in pythonBuilding a scalable online backup system in python
Building a scalable online backup system in pythonJoe Drumgoole
 
Tricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly FrameworkTricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly Frameworkelliando dias
 
What every Java developer should know about network?
What every Java developer should know about network?What every Java developer should know about network?
What every Java developer should know about network?aragozin
 

Was ist angesagt? (20)

Web sockets in Java
Web sockets in JavaWeb sockets in Java
Web sockets in Java
 
Going Live! with Comet
Going Live! with CometGoing Live! with Comet
Going Live! with Comet
 
WebSockets On Fire
WebSockets On FireWebSockets On Fire
WebSockets On Fire
 
Time for Comet?
Time for Comet?Time for Comet?
Time for Comet?
 
vlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentationvlavrynovych - WebSockets Presentation
vlavrynovych - WebSockets Presentation
 
DDoS: practical survival
DDoS: practical survivalDDoS: practical survival
DDoS: practical survival
 
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerryjWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
jWebSocket MobileTechCon 2010 - WebSockets on Android, Symbian and BlackBerry
 
Altitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the EdgeAltitude San Francisco 2018: Programming the Edge
Altitude San Francisco 2018: Programming the Edge
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
ZN27112015
ZN27112015ZN27112015
ZN27112015
 
wa-cometjava-pdf
wa-cometjava-pdfwa-cometjava-pdf
wa-cometjava-pdf
 
HTML5 WebSocket Introduction
HTML5 WebSocket IntroductionHTML5 WebSocket Introduction
HTML5 WebSocket Introduction
 
Avatar Maven
Avatar MavenAvatar Maven
Avatar Maven
 
WebSockets with Spring 4
WebSockets with Spring 4WebSockets with Spring 4
WebSockets with Spring 4
 
Systems Introspection
Systems IntrospectionSystems Introspection
Systems Introspection
 
TLS - 2016 Velocity Training
TLS - 2016 Velocity TrainingTLS - 2016 Velocity Training
TLS - 2016 Velocity Training
 
Building a scalable online backup system in python
Building a scalable online backup system in pythonBuilding a scalable online backup system in python
Building a scalable online backup system in python
 
Tricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly FrameworkTricks and Tips With NIO Using the Grizzly Framework
Tricks and Tips With NIO Using the Grizzly Framework
 
Intro to WebSockets
Intro to WebSocketsIntro to WebSockets
Intro to WebSockets
 
What every Java developer should know about network?
What every Java developer should know about network?What every Java developer should know about network?
What every Java developer should know about network?
 

Andere mochten auch

The Yemen-Arabia Felix
 The Yemen-Arabia Felix The Yemen-Arabia Felix
The Yemen-Arabia FelixAlan Doherty
 
Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...
Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...
Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...Geert Wissink
 
Integer Review!
Integer Review!Integer Review!
Integer Review!ejboggs
 
Sales Training ROI: An Oxymoron No More
Sales Training ROI: An Oxymoron No MoreSales Training ROI: An Oxymoron No More
Sales Training ROI: An Oxymoron No MoreCallidus Software
 
ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~
ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~
ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~Hikaru GOTO
 
Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...
Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...
Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...Amazon Web Services
 
Marco Vergani, E-commerce
Marco Vergani, E-commerceMarco Vergani, E-commerce
Marco Vergani, E-commerceAndrea Rossetti
 
Alessandro Nicotra, Seminario Internet Governance
Alessandro Nicotra, Seminario Internet GovernanceAlessandro Nicotra, Seminario Internet Governance
Alessandro Nicotra, Seminario Internet GovernanceAndrea Rossetti
 
getting started with amazon aurora
getting started with amazon auroragetting started with amazon aurora
getting started with amazon auroraAmazon Web Services
 
Putting GRAPHics into geoGRAPHy presentations
Putting GRAPHics into geoGRAPHy presentationsPutting GRAPHics into geoGRAPHy presentations
Putting GRAPHics into geoGRAPHy presentationsAlan Doherty
 
The Amazon Basin - a Contested Landscape
The Amazon Basin - a Contested LandscapeThe Amazon Basin - a Contested Landscape
The Amazon Basin - a Contested LandscapeAlan Doherty
 
Blue Raster Presentation for Earth Observation in the Cloud Demo Day
Blue Raster Presentation for Earth Observation in the Cloud Demo DayBlue Raster Presentation for Earth Observation in the Cloud Demo Day
Blue Raster Presentation for Earth Observation in the Cloud Demo DayAmazon Web Services
 
Luigi vannutelli, La dinamica dei Contratti ICT in Azienda
Luigi vannutelli, La dinamica dei Contratti ICT in AziendaLuigi vannutelli, La dinamica dei Contratti ICT in Azienda
Luigi vannutelli, La dinamica dei Contratti ICT in AziendaAndrea Rossetti
 
Dizzying Decimals
Dizzying DecimalsDizzying Decimals
Dizzying Decimalsejboggs
 

Andere mochten auch (20)

The Yemen-Arabia Felix
 The Yemen-Arabia Felix The Yemen-Arabia Felix
The Yemen-Arabia Felix
 
Cff Pr
Cff PrCff Pr
Cff Pr
 
riee
rieeriee
riee
 
Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...
Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...
Budgeting and Funding - Lecture for Preservation & Presentation of the Moving...
 
Integer Review!
Integer Review!Integer Review!
Integer Review!
 
Sales Training ROI: An Oxymoron No More
Sales Training ROI: An Oxymoron No MoreSales Training ROI: An Oxymoron No More
Sales Training ROI: An Oxymoron No More
 
ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~
ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~
ケーズデンキの企業行動とパフォーマンス ~サービス差別化戦略の成功~
 
Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...
Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...
Keep Cloud Transformation on Track: Nine Best Practices to Avoid or Break Thr...
 
she
sheshe
she
 
教案與教材設計
教案與教材設計教案與教材設計
教案與教材設計
 
Marco Vergani, E-commerce
Marco Vergani, E-commerceMarco Vergani, E-commerce
Marco Vergani, E-commerce
 
Social Media Strategy
Social Media StrategySocial Media Strategy
Social Media Strategy
 
Alessandro Nicotra, Seminario Internet Governance
Alessandro Nicotra, Seminario Internet GovernanceAlessandro Nicotra, Seminario Internet Governance
Alessandro Nicotra, Seminario Internet Governance
 
getting started with amazon aurora
getting started with amazon auroragetting started with amazon aurora
getting started with amazon aurora
 
sheNati
sheNatisheNati
sheNati
 
Putting GRAPHics into geoGRAPHy presentations
Putting GRAPHics into geoGRAPHy presentationsPutting GRAPHics into geoGRAPHy presentations
Putting GRAPHics into geoGRAPHy presentations
 
The Amazon Basin - a Contested Landscape
The Amazon Basin - a Contested LandscapeThe Amazon Basin - a Contested Landscape
The Amazon Basin - a Contested Landscape
 
Blue Raster Presentation for Earth Observation in the Cloud Demo Day
Blue Raster Presentation for Earth Observation in the Cloud Demo DayBlue Raster Presentation for Earth Observation in the Cloud Demo Day
Blue Raster Presentation for Earth Observation in the Cloud Demo Day
 
Luigi vannutelli, La dinamica dei Contratti ICT in Azienda
Luigi vannutelli, La dinamica dei Contratti ICT in AziendaLuigi vannutelli, La dinamica dei Contratti ICT in Azienda
Luigi vannutelli, La dinamica dei Contratti ICT in Azienda
 
Dizzying Decimals
Dizzying DecimalsDizzying Decimals
Dizzying Decimals
 

Ähnlich wie Comet: Making The Web a 2-Way Medium

Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDoris Chen
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008Joe Walker
 
Comet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsComet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsCodemotion
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTFrank Greco
 
[DSBW Spring 2009] Unit 02: Web Technologies (1/2)
[DSBW Spring 2009] Unit 02: Web Technologies (1/2)[DSBW Spring 2009] Unit 02: Web Technologies (1/2)
[DSBW Spring 2009] Unit 02: Web Technologies (1/2)Carles Farré
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008Association Paris-Web
 
Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesMakoto Inoue
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NETAlessandro Giorgetti
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawnozten
 

Ähnlich wie Comet: Making The Web a 2-Way Medium (20)

Grizzly Comet Aquarium Paris
Grizzly Comet Aquarium ParisGrizzly Comet Aquarium Paris
Grizzly Comet Aquarium Paris
 
Developing Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax PushDeveloping Revolutionary Web Applications using Comet and Ajax Push
Developing Revolutionary Web Applications using Comet and Ajax Push
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008
 
Comet / WebSocket Web Applications
Comet / WebSocket Web ApplicationsComet / WebSocket Web Applications
Comet / WebSocket Web Applications
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
ServerSentEventsV2.pdf
ServerSentEventsV2.pdfServerSentEventsV2.pdf
ServerSentEventsV2.pdf
 
[DSBW Spring 2009] Unit 02: Web Technologies (1/2)
[DSBW Spring 2009] Unit 02: Web Technologies (1/2)[DSBW Spring 2009] Unit 02: Web Technologies (1/2)
[DSBW Spring 2009] Unit 02: Web Technologies (1/2)
 
Meteor ddp
Meteor ddpMeteor ddp
Meteor ddp
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Node js
Node jsNode js
Node js
 
Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup Slides
 
gofortution
gofortutiongofortution
gofortution
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET
 
02 intro
02   intro02   intro
02 intro
 
Web Leaps Forward
Web Leaps ForwardWeb Leaps Forward
Web Leaps Forward
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
introduction to web application development
introduction to web application developmentintroduction to web application development
introduction to web application development
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawn
 

Kürzlich hochgeladen

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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
[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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Kürzlich hochgeladen (20)

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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
[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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

Comet: Making The Web a 2-Way Medium

  • 1. Comet: Making The Web a 2-Way Medium Joe Walker, DWR Lead Developer
  • 2. What is Comet? Long lived HTTP connections •Low latency data •For events outside the browser
  • 4. Why? Ajax made individual pages interactive places to explore More and more of the data on the web is social and therefore changing
  • 5. Why? Time people spend on a page Time before a page changes Evolution of the Web
  • 6. Why? Simply keeping a page up to date is easy: poll But polling kills servers Comet keeps pages up to date *efficiently*
  • 7. But ... It’s a hack - the web is biased against it
  • 8. Does that stop us? Ajax is also a hack, but that hasn’t stopped it And Comet does work
  • 9. Examples of Comet Chat is everywhere: GMail, Meebo, Yahoo Mail, etc. GMail uses it to update email conversations Google Docs uses it to show you other collaborators actions yes.com uses it to track radio station playlists Polar Rose are using it for delayed photo recognition GPokr is using it for online gaming etc...
  • 11. Client Tricks Maximum of 2 connections per browser per host •Coordination using window.name in the client •or cookies using a server •or use multi-home DNS HTTP streaming is download only (chunked mode) TCP connections are kept alive under HTTP 1.1 Server detection of failed connections
  • 12. Client How-to: Forever Frame Client posts an iframe which doesn’t close quickly •Send text/plain and poll in browser (not IE) •Send text/plain with 4k whitespace to flush IE •Flush with a <script> tag for each data block The iframe will need killing and restarting to avoid memory leak But IE clicks when iframe starts
  • 13. Client How-to: Long Polling Client makes an XHR request which does not return immediately IE disallows reading XHR.responseText until connection is closed Although you can keep XHR frames open forever, generally you poll
  • 14. Client How-to: htmlfile ‘htmlfile’ is an ActiveX control like XHR: htmlfile = new ActiveXObject(quot;htmlfilequot;); htmlfile.open(); htmlfile.write(quot;<html><iframe src='javascript:void(0)' onload='cleanup();'></iframe></html>quot;); htmlfile.close(); htmlfile.parentWindow.dwr = dwr; Avoids ‘clicking’, but doesn’t work in IE/Server 2003 Not supported in Firefox, Safari, Opera, etc.
  • 15. Client How-to: Callback Polling Create <script> blocks pointing to any domain Create new script block when last completes
  • 16. Client How-to: Other Options Mime Messaging: •Uses Multipart Mime in HTML: x-multipart-replace •Not in IE •Excellent performance Flash •We probably have enough other options that we don’t need to get into plugins
  • 17. Server Tricks Watch out for stream-stoppers •Apache: mod_jk •Buggy network proxies •Various application firewalls Watch out for thread starvation
  • 19. Saving you the Pain On the Server: •Jetty, Twisted Python, Grizzly, Lighttpd, Perbal Event Buses •Cometd, mod_pubsub, mod_repubsub, Lightstreamer, KnowHow, HAppS Frameworks •DWR, Juggernaut, Nevow
  • 20. Bayeux Standard Protocol for Interoperable Comet Supported by: •Cometd, Jetty, Dojo, DWR and servers in development from BEA, IBM and Sun
  • 21. Bayeux on the Client via Cometd Dojo client implementation: dojox.cometd.init(serverUrl); dojox.cometd.publish(quot;/topicquot;, {/* payload */}); dojox.cometd.subscribe(quot;/topicquot;, function(){/* ... */ });
  • 22. Bayeux on the Server package dojox.cometd; public interface Bayeux { Client newClient(String idprefix, Listener listener); void publish(Client fromClient, String toChannel, Object data, String msgId); void subscribe(String toChannel, Client subscriber); ... }
  • 23. DWR Reverse Ajax == Comet + Polling + Piggyback (It’s just a configuration option) Allowing the server to easily manage groups of users
  • 24. DWR, Reverse Ajax DWR calling remote Javascript Collection sessions = context.getScriptSessionsByPage(url); ScriptProxy proxy = new ScriptProxy(sessions); proxy.addFunctionCall(quot;updateCallersquot;, calls);
  • 25. DWR, Reverse Ajax DWR calling remote Script.aculo.us Collection sessions = context.getScriptSessionsByPage(url); Effect e = new Effect(sessions); e.fade(quot;client-idquot;);
  • 26. DWR, Reverse Ajax DWR calling remote TIBCO GI Collection sessions = context.getScriptSessionsByPage(url); Server server = GI.getServer(sessions, quot;appnamequot;); Button button = server.getJSXById(quot;buttonquot;, Button.class); button.setEnabled(Form.STATEDISABLED, true);
  • 29. Demo http://www.webtide.com/sessionRater/
  • 30. Demo
  • 31. Questions? http://cometdaily.com/ http://getahead.org/blog/joe/ http://cometd.com/ http://directwebremoting.org/