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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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)
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
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
 
[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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 

Kürzlich hochgeladen (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
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 ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 

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