PDA

View Full Version : HttpProxy adjustable timeout ?


kalebwalton
03-23-2007, 08:49 AM
It would be nice if we could adjust the timeout on the XHR in the HttpProxy (without having to extend it). I think it's 30 seconds and unfortunately at times, the queries in my dev environment can take longer than that.

willydee
03-23-2007, 01:33 PM
That's easy to solve. Just pass a config option to the constructor, it is passed then to the underlying connection instance:

var proxy = new Ext.data.HttpProxy({
method: 'POST',
url: '/path/to/my/data/',
timeout: 90000
});

kalebwalton
03-23-2007, 01:37 PM
Ah great :) Didn't think about that. Thanks!

ajaxE
09-12-2007, 02:11 AM
It seems didn't work for me. I am using ExtJs1.1. Any help is greatly appreciated!!

Thanks!

thejdog
09-12-2007, 02:14 AM
It seems didn't work for me. I am using ExtJs1.1. Any help is greatly appreciated!!

Thanks!

What's your script execution time on your server? Are you using PHP, ASP, Perl, Java? I know with PHP there is a max script execution time you can set (even per script). Some of the scripts I have need a higher one because it's running queries on 16 million row tables.

Jul
09-12-2007, 02:30 AM
Take a look at this thread (http://extjs.com/forum/showthread.php?p=62342#post62342). I think the timeout config option needs to be encapsulated in an object... which I think is undocumented.

Animal
09-12-2007, 03:37 AM
var proxy = new Ext.data.HttpProxy({
method: 'POST',
url: '/path/to/my/data/',
timeout: 90000
});


Won't work

The parameter to the HttpProxy constructor is either an Ext.data.Connection, or a options object for an http://extjs.com/deploy/ext/docs/output/Ext.Ajax.html#request call.

If you instantiate an Ext.data.Connection with a timeout value, and pass that, that it will work.

I think timeout should be an allowed option to Ext.data.Connection.request (and by implication to Ext.Ajax.request because Ext.Ajax is an instance of Connection)

I think this means an enhancement request is in order.

Animal
09-12-2007, 03:42 AM
Premium members, do you want to add your votes?

http://extjs.com/forum/showthread.php?p=62422#post62422

hendricd
09-12-2007, 07:38 AM
Your options are either:


var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy(new Ext.data.Connection({url:'somwhere.php', timeout:20000})),
reader: new Ext.data.ArrayReader({}, [...]),
remoteSort: true
});
ds.load({});


or simply:

var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'somwhere.php'}),
reader: new Ext.data.ArrayReader({}, [...]),
remoteSort: true
});

Ext.Ajax.timeout = 20000;
ds.load({});


Right?

Animal
09-12-2007, 08:04 AM
Yep.

ajaxE
09-17-2007, 04:00 PM
Doug Hendricks's code was very helpful. It worked!!

Thanks a lot!!

andygalaxia
06-13-2009, 06:50 PM
At same Store, i changed timeout value of proxy, this way:

store.proxy.getConnection().timeout = 180000;