Jay Shirley![]()
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.
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)
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();
});
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