PDA

View Full Version : The use of the poll array of transaction ids in Ext.lib.Ajax



matthewpelser
4 Feb 2010, 6:02 AM
I am trying to understand how the Ext.lib.Ajax part of the library handles calls and would like to know what role the following code in the function handleReadyState is.

poll[tId] = setInterval(
function() {
if (conn && conn.readyState == 4) {
clearInterval(poll[tId]);
poll[tId] = null;

if (cbTimeout) {
clearTimeout(pub.timeout[tId]);
pub.timeout[tId] = null;
}

handleTransactionResponse(o, callback);
}
},
pub.pollInterval);

As handleReadyState should be called on each change of state what is the setInterval code used for? Could handleTransactionResponse(o, callback) be delt with in the handleReadyState function?

Thanks for taking the time to read this, im sure im missing out on something obvious.

Matt.