SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Reverse-Ajax

    Par Mathieu Carbou, le 17 avril 2011




       Samples à https://github.com/Ovea/conf-reverse-ajax


Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Reverse Ajax refers to an Ajax design
   pattern   that   uses    long-lived   HTTP
   connections     to    enable   low-latency
   communication between a web server and a
   browser. Basically it is a way of sending
   data from client to server and a mechanism
   for pushing server data back to the
   browser.




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Event-Driven Web Applications




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Reverse-Ajax techniques


        1.     Polling
        2.     Piggyback
        3.     Comet
        4.     WebSockets



Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Polling


    I.e. Check for messages each 4 seconds




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Polling



                                 DEMO




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
2. Piggyback


    Check for messages when an action is
    performed.




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
2. Piggyback



                                 DEMO




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Comet


    A long-held HTTP request allows a web
    server to push data to a browser, without
    the browser explicitly requesting it.




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Comet techniques

        1.Long polling
          ● XMLHttpRequest
          ● Script tag

        2.Stream based
          ● Forever Iframe
          ● XMLHttpRequest Multipart
Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Comet



                                 DEMO

            XMLHttpRequest Long Polling
             (with Jetty Coninuations)

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Comet



                                 DEMO

          XMLHttpRequest Multipart
         (with Jetty Coninuations)

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Comet



                                 DEMO

            XMLHttpRequest Multipart
             (with Servlet 3.0 API)

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
4. WebSockets


    WebSocket & FlashSockets

    WebSocket is a technology providing for
    bi-directional, full-duplex
    communications channels. It is designed
    to be implemented in web browsers and web
    servers but it can be used by any client
    or server application .

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
4. WebSockets



                                 DEMO




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Reverse-Ajax for Java

    ●   Cannot use standard Servlets
    ●   Cannot use blocking I/O
    ●   Cannot retain request thread

        => Needs NIO + Features



Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Reverse-Ajax for Java

        You need 3 things:

    1. A good server (NIO)

    2. A good client library

    3. A good backend library
Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Servers


     ●   Jetty 8 (WebSocket, Comet)
     ●   Grizzly (WebSocket, Comet)
     ●   Tomcat 7 (Comet)

     ●   All Servlet 3.0 based


Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Servers

     ● For WebSocket: only native, per
     container (i.e. WebSocketServlet)

     ● For Comet: Servlet 3.0
     containers, Jetty Continuations

     ●   Polling, Piggyback anywhere

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Libraries


        1.     Socket.IO
        2.     Atmosphere
        3.     Cometd Bayeux
        4.     [...]



Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Socket.IO (transports)


        ●   WebSocket
        ●   Adobe Flash Socket
        ●   Comet Long Polling
        ●   Comet Multipart Streaming
        ●   Comet Forever Iframe
        ●   JSONP Polling

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Socket.IO (client)

    ● Very good API
    ● Desktop & Mobile & Client-Server

    ● Fallback, reconnect, offline

    messages, event-driven, …

    ●   Event-Driven bridge (Ovea)

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Socket.IO (client)

        ●   Internet Explorer 5.5 – 8
        ●   Safari 3 - 5
        ●   Google Chrome 4 - 6
        ●   Firefox 3-4
        ●   Opera 10.61
        ●   iPhone Safari
        ●   iPad Safari
        ●   Android WebKit
        ●   WebOs WebKit
Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Socket.IO-Java


    ●   Jetty Continuations (portable in
    any container)
    ● Native Jetty Websockets

    ● Servlet 3.0 support




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
1. Socket.IO



                                 DEMO




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Event-Driven Web



                                 DEMO

            Socket.IO + Ovea EventBus


Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
2. Atmosphere (transports)

      ●   WebSocket
      ●   Comet (Polling & Streaming)




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
2. Atmosphere (client)

      ●   Currently limited !
      ●   JQuery integration

      ●   BUT integration is possible
           ● With Cometd
           ● Socket.IO (to come ?)

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
2. Atmosphere (java)

      ●   Nearly all containers
      ●   Best native support
      ●   Container detection
      ●   WebSocket




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
2. Atmosphere



                                 DEMO




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Cometd (transports)

      ●   WebSocket
      ●   Comet Long Polling
      ●   JSONP Polling

      ● The most reliable and
      performant

Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Cometd (client)


    ● Event-based
    ● Jquery / Dojo

    ● Desktop & Mobile & Client-

    Server, Any Browser
    ● Extensions

    ● Very good API




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Cometd (java)


    ●   Jetty Continuations (portable in
    any container)
    ● Native Jetty Websockets

    ● Servlet 3.0 support




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
3. Cometd



                                 DEMO




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Resources (info)


       ➔   Exploring Reverse AJAX
       ➔   Comet
       ➔   WebSocket
       ➔   Portable Jetty Continuations




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Resources (projects)


       ➔   EventBus
       ➔   Socket.IO
       ➔   Socket.IO (Java)
       ➔   Atmosphere
       ➔   Cometd Bayeux




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com
Reverse-Ajax

                            QUESTIONS ?




Site: http://lab.ovea.com/
Blog: http://blog.mycila.com
Mail: mathieu.carbou@gmail.com

Mais conteúdo relacionado

Mais procurados

Comet web applications with Python, Django & Orbited
Comet web applications with Python, Django & OrbitedComet web applications with Python, Django & Orbited
Comet web applications with Python, Django & Orbitedskam
 
Automated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.orgAutomated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.orgFrancis Luong
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and JavaAsynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and JavaJames Falkner
 
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9Ilya Grigorik
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsJack Franklin
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)Ericom Software
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
Using Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web ApplicationsUsing Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web ApplicationsNicholas Jansma
 
The MetaCPAN VM for Dummies Part One (Installation)
The MetaCPAN VM for Dummies Part One (Installation)The MetaCPAN VM for Dummies Part One (Installation)
The MetaCPAN VM for Dummies Part One (Installation)Olaf Alders
 
Full-Stack Plone Deployment with Ansible
Full-Stack Plone Deployment with AnsibleFull-Stack Plone Deployment with Ansible
Full-Stack Plone Deployment with AnsibleSteve McMahon
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsersjeresig
 
SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)Robert Swisher
 
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on TomcatApache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on TomcatTomitribe
 
Plone Deployment Secrets & Tricks
Plone Deployment Secrets & TricksPlone Deployment Secrets & Tricks
Plone Deployment Secrets & TricksSteve McMahon
 
Plone Deployment (PloneConf Edition)
Plone Deployment (PloneConf Edition)Plone Deployment (PloneConf Edition)
Plone Deployment (PloneConf Edition)Steve McMahon
 

Mais procurados (20)

Websocket 101 in Python
Websocket 101 in PythonWebsocket 101 in Python
Websocket 101 in Python
 
Comet web applications with Python, Django & Orbited
Comet web applications with Python, Django & OrbitedComet web applications with Python, Django & Orbited
Comet web applications with Python, Django & Orbited
 
Automated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.orgAutomated Releases to RubyGems.org using Travis-CI.org
Automated Releases to RubyGems.org using Travis-CI.org
 
Asynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and JavaAsynchronous Web Programming with HTML5 WebSockets and Java
Asynchronous Web Programming with HTML5 WebSockets and Java
 
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
WebSockets Everywhere: the Future Transport Protocol for Everything (Almost)
 
HTTP2 is Here!
HTTP2 is Here!HTTP2 is Here!
HTTP2 is Here!
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Using Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web ApplicationsUsing Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web Applications
 
The MetaCPAN VM for Dummies Part One (Installation)
The MetaCPAN VM for Dummies Part One (Installation)The MetaCPAN VM for Dummies Part One (Installation)
The MetaCPAN VM for Dummies Part One (Installation)
 
Measuring Continuity
Measuring ContinuityMeasuring Continuity
Measuring Continuity
 
Full-Stack Plone Deployment with Ansible
Full-Stack Plone Deployment with AnsibleFull-Stack Plone Deployment with Ansible
Full-Stack Plone Deployment with Ansible
 
webworkers
webworkerswebworkers
webworkers
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)
 
Learnings from govuk
Learnings from govukLearnings from govuk
Learnings from govuk
 
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on TomcatApache TomEE, Java EE 6 Web Profile {and more} on Tomcat
Apache TomEE, Java EE 6 Web Profile {and more} on Tomcat
 
Plone Deployment Secrets & Tricks
Plone Deployment Secrets & TricksPlone Deployment Secrets & Tricks
Plone Deployment Secrets & Tricks
 
Plone Deployment (PloneConf Edition)
Plone Deployment (PloneConf Edition)Plone Deployment (PloneConf Edition)
Plone Deployment (PloneConf Edition)
 

Semelhante a Reverse Ajax

Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossugclkao
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkFabio Tiriticco
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketbrent bucci
 
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010sullis
 
Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010sullis
 
Peter lubbers-html5-offline-web-apps
Peter lubbers-html5-offline-web-appsPeter lubbers-html5-offline-web-apps
Peter lubbers-html5-offline-web-appsSkills Matter
 
Web Standards Support in WebKit
Web Standards Support in WebKitWeb Standards Support in WebKit
Web Standards Support in WebKitJoone Hur
 
Graph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glassGraph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glassGerard Klijs
 
Graph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGraph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGerard Klijs
 
ONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s CasablancaONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s CasablancaVictor Morales
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Going Headless with Craft CMS 3.3
Going Headless with Craft CMS 3.3Going Headless with Craft CMS 3.3
Going Headless with Craft CMS 3.3JustinHolt20
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoAlessandro Nadalin
 
Real-Time Web applications with WebSockets
Real-Time Web applications with WebSocketsReal-Time Web applications with WebSockets
Real-Time Web applications with WebSocketsStanislav Zozulia
 

Semelhante a Reverse Ajax (20)

Redis Introduction
Redis IntroductionRedis Introduction
Redis Introduction
 
Websockets at tossug
Websockets at tossugWebsockets at tossug
Websockets at tossug
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Rails 生態圈一覽
Rails 生態圈一覽Rails 生態圈一覽
Rails 生態圈一覽
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
 
Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010Programming WebSockets - April 20 2010
Programming WebSockets - April 20 2010
 
Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010
 
Selenium cloud
Selenium cloudSelenium cloud
Selenium cloud
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Web-Socket
Web-SocketWeb-Socket
Web-Socket
 
Peter lubbers-html5-offline-web-apps
Peter lubbers-html5-offline-web-appsPeter lubbers-html5-offline-web-apps
Peter lubbers-html5-offline-web-apps
 
Web Standards Support in WebKit
Web Standards Support in WebKitWeb Standards Support in WebKit
Web Standards Support in WebKit
 
Graph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glassGraph ql subscriptions through the looking glass
Graph ql subscriptions through the looking glass
 
Graph ql subscriptions on the jvm
Graph ql subscriptions on the jvmGraph ql subscriptions on the jvm
Graph ql subscriptions on the jvm
 
ONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s CasablancaONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s Casablanca
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Going Headless with Craft CMS 3.3
Going Headless with Craft CMS 3.3Going Headless with Craft CMS 3.3
Going Headless with Craft CMS 3.3
 
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San FranciscoHTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco
 
Real-Time Web applications with WebSockets
Real-Time Web applications with WebSocketsReal-Time Web applications with WebSockets
Real-Time Web applications with WebSockets
 
WebGL Awesomeness
WebGL AwesomenessWebGL Awesomeness
WebGL Awesomeness
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Reverse Ajax

  • 1. Reverse-Ajax Par Mathieu Carbou, le 17 avril 2011 Samples à https://github.com/Ovea/conf-reverse-ajax Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 2. Reverse Ajax refers to an Ajax design pattern that uses long-lived HTTP connections to enable low-latency communication between a web server and a browser. Basically it is a way of sending data from client to server and a mechanism for pushing server data back to the browser. Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 4. Reverse-Ajax techniques 1. Polling 2. Piggyback 3. Comet 4. WebSockets Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 5. 1. Polling I.e. Check for messages each 4 seconds Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 6.
  • 7. 1. Polling DEMO Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 8. 2. Piggyback Check for messages when an action is performed. Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 9.
  • 10. 2. Piggyback DEMO Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 11. 3. Comet A long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 12.
  • 13. 3. Comet techniques 1.Long polling ● XMLHttpRequest ● Script tag 2.Stream based ● Forever Iframe ● XMLHttpRequest Multipart Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 14. 3. Comet DEMO XMLHttpRequest Long Polling (with Jetty Coninuations) Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 15. 3. Comet DEMO XMLHttpRequest Multipart (with Jetty Coninuations) Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 16. 3. Comet DEMO XMLHttpRequest Multipart (with Servlet 3.0 API) Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 17. 4. WebSockets WebSocket & FlashSockets WebSocket is a technology providing for bi-directional, full-duplex communications channels. It is designed to be implemented in web browsers and web servers but it can be used by any client or server application . Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 18.
  • 19. 4. WebSockets DEMO Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 20. Reverse-Ajax for Java ● Cannot use standard Servlets ● Cannot use blocking I/O ● Cannot retain request thread => Needs NIO + Features Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 21. Reverse-Ajax for Java You need 3 things: 1. A good server (NIO) 2. A good client library 3. A good backend library Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 22. Servers ● Jetty 8 (WebSocket, Comet) ● Grizzly (WebSocket, Comet) ● Tomcat 7 (Comet) ● All Servlet 3.0 based Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 23. Servers ● For WebSocket: only native, per container (i.e. WebSocketServlet) ● For Comet: Servlet 3.0 containers, Jetty Continuations ● Polling, Piggyback anywhere Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 24. Libraries 1. Socket.IO 2. Atmosphere 3. Cometd Bayeux 4. [...] Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 25. 1. Socket.IO (transports) ● WebSocket ● Adobe Flash Socket ● Comet Long Polling ● Comet Multipart Streaming ● Comet Forever Iframe ● JSONP Polling Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 26. 1. Socket.IO (client) ● Very good API ● Desktop & Mobile & Client-Server ● Fallback, reconnect, offline messages, event-driven, … ● Event-Driven bridge (Ovea) Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 27. 1. Socket.IO (client) ● Internet Explorer 5.5 – 8 ● Safari 3 - 5 ● Google Chrome 4 - 6 ● Firefox 3-4 ● Opera 10.61 ● iPhone Safari ● iPad Safari ● Android WebKit ● WebOs WebKit Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 28. 1. Socket.IO-Java ● Jetty Continuations (portable in any container) ● Native Jetty Websockets ● Servlet 3.0 support Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 29. 1. Socket.IO DEMO Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 30. Event-Driven Web DEMO Socket.IO + Ovea EventBus Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 31. 2. Atmosphere (transports) ● WebSocket ● Comet (Polling & Streaming) Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 32. 2. Atmosphere (client) ● Currently limited ! ● JQuery integration ● BUT integration is possible ● With Cometd ● Socket.IO (to come ?) Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 33. 2. Atmosphere (java) ● Nearly all containers ● Best native support ● Container detection ● WebSocket Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 34. 2. Atmosphere DEMO Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 35. 3. Cometd (transports) ● WebSocket ● Comet Long Polling ● JSONP Polling ● The most reliable and performant Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 36. 3. Cometd (client) ● Event-based ● Jquery / Dojo ● Desktop & Mobile & Client- Server, Any Browser ● Extensions ● Very good API Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 37. 3. Cometd (java) ● Jetty Continuations (portable in any container) ● Native Jetty Websockets ● Servlet 3.0 support Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 38. 3. Cometd DEMO Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 39. Resources (info) ➔ Exploring Reverse AJAX ➔ Comet ➔ WebSocket ➔ Portable Jetty Continuations Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 40. Resources (projects) ➔ EventBus ➔ Socket.IO ➔ Socket.IO (Java) ➔ Atmosphere ➔ Cometd Bayeux Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com
  • 41. Reverse-Ajax QUESTIONS ? Site: http://lab.ovea.com/ Blog: http://blog.mycila.com Mail: mathieu.carbou@gmail.com