• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    io-stream (gallery-io-stream)

    Last Updated: 02/19/10
    + 0 -

    Jay Shirley

    YUI Contributor

    Created: 11/6/09
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.0.0
    Free for use.

    This module aims to fully support streaming XmlHttpRequest connections, similar to what Digg Labs is doing (http://blog.digg.com/?p=621) except using YUI3 and the existing IO framework.

    • Tags:
    • mxhr
    • jay shirley
    • jshirley
    • io-stream
    • stream
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    This connects to a multipart XmlHttpRequest streaming service, and emits signals when a packet is available for reading.

    You must have a streaming HTTP service to make full use of this module. I have been using Tatsumaki (my fork is http://github.com/jshirley/tatsumaki)

    Code Sample

    YUI().use('gallery-io-stream', function(Y) {
        var stream_uri = '/chat/twitter/mxhrpoll?session=' + Math.random();
        var stream = new Y.IOStream({
            uri: stream_uri,
        });
        var output = Y.one('#stream');
        Y.on('stream:packet', 
            function(body, headers) {
                var data = Y.JSON.parse(body);
                output.prepend(
                    "<dt><a href=\"" + data.ident + "\"><img src=\"" + data.avatar + "\" height=\"32\"></a></dt><dd>" + data.html + "</dd>"); 
            }
        );
        stream.start();
    });
     

    Forum Posts

    No forum posts for this module.

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info