John Lindal![]()
This IO module allows the server to return an unlimited number of responses to a single request. This can be useful if you need to return results in small batches, as they become available, instead of all at once, after the processing is finished. It is also useful as a replacement for chained requests. The chaining logic can be implemented on the server, so the server doesn't have to wait for the next request before working on it.
Simple example of making a multiresponse call to the server. You can also specify data and/or a form (possibly with upload:true), just like with any other call to Y.io().
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.06.27-20-10'
}).use('gallery-io-multiresponse', function(Y)
{
Y.io('my-multi-response-uri',
{
multiresponse: true,
json: { b:2, y:'z' }, // will be serialized and sent as the json parameter
on:
{
response: function(id, data)
{
// data contains the object returned by the server
// This function is invoked for every response.
}
}
});
});| Subject | Author | Date |
|---|---|---|
| Why Multi-response not return request object? | Mayank Gupta | 06/17/12 |
| Re: Why Multi-response not return request object? | John Lindal | 06/22/12 |
| Re: Why Multi-response not return request object? | Mayank Gupta | 06/29/12 |
© 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