Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] connection manager and chunked transfer encoding: reading data before response completes

Expand Messages
  • Adam Platti
    IE s XmlHttpRequest has an ondataready event which fires periodically as data becomes availab.e I dont think any other browsers support it, though. It would
    Message 1 of 1 , May 6 9:09 PM
    • 0 Attachment
      IE's XmlHttpRequest has an ondataready event which fires periodically as data becomes availab.e  I dont think any other browsers support it, though.   It would have to be supported by all A-grade browsers for YUI to consider adding it as a feature.

      Adam

      ----- Original Message ----
      From: Jack Bates <ms419@...>
      To: ydn-javascript@yahoogroups.com
      Sent: Sunday, May 6, 2007 11:21:50 PM
      Subject: [ydn-javascript] connection manager and chunked transfer encoding: reading data before response completes

      HTTP servers can use Transfer-Encoding: chunked to send data to clients
      before the entire response is generated. In this way additional data can
      be added to the response as events occur on the server. I'd like to use
      this feature to avoid polling: Make a long-lived request to my HTTP
      server using YUI's connection manager and execute a callback when new
      data is available.

      In other programming languages, I'd read data from the socket as it
      became available, but I'm not sure how to do this with JavaScript /
      AJAX / YUI. Is a YUI connection manager callback only called when the
      _entire_ response has been received? Is there any way with YUI to get
      response data as soon as it's available, before the response is
      complete? I suspect the answer why / why not has something to do with
      the underlying XmlHttpRequest / ActiveX object?

      The application I'm working on is a real-time multi-user edit system, so
      I want to get notified by the server of edits by other users as quickly
      as possible. I'd like to avoid polling the server for edits by other
      users. Has anyone else had experience with this type of problem? Any
      suggestions, recommended designs or warnings of things to watch out for?

      Thanks! Jack

    Your message has been successfully submitted and would be delivered to recipients shortly.