You cannot anticipate servers response time. Ok, it's the same file, so what,
it'll always be returned with different times.
No way around that.
On Aug 8, 2011, at 9:10 PM, Sid-ahmed D wrote:
> It was what i do ...
>
>
> RQ1 = new Request.HTML({
> method: 'get',
> async : true,
> url:'test.php',
> onRequest:function(a, b, c, d){},
> onSuccess: function(a, b, c, d){
> console.log('success RQ1')
> }
> });
>
> RQ2 = new Request.HTML({
> method: 'get',
> async : true,
> url:'test.php',
> onRequest:function(a, b, c, d){},
> onSuccess: function(a, b, c, d){
> console.log('success RQ2')
> }
> });
>
> RQ1.send();
> RQ2.send();
>
> test.php --> execution time : 5 seconds.
>
>
> When i refresh my page, i see my console log and i see this :
>
> GET test.php 200 OK 5.02s
> GET test.php 200 OK 10.03s
> console.log('success RQ1')
> console.log('success RQ2')
>
> The correct return will be ..
>
> GET test.php 200 OK 5.*s
> GET test.php 200 OK 5.*s +/-
>
>
> On Aug 8, 9:01 pm, Philip Thompson <[email protected]> wrote:
>> You cannot run a single instance of Request.* simultaneously. To run
>> requests simultaneously, you will need an instance for each request.
>>
>> Request.HTML({...}).send();
>> Request.HTML({...}).send();
>> Request.HTML({...}).send();
>>
>> And so forth... These will run simultaneously. However, these will not:
>>
>> var req = Request.HTML({...});
>> req.send();
>> req.send();
>> req.send();
>>
>> Depending on what you have set for "link," these request will be ignored,
>> cancelled, or chained. Creating multiple instances of Request.* and having
>> them run simultaneously will not block the user...
>>
>> ~Philip
>>
>> On Mon, Aug 8, 2011 at 1:30 PM, Sid-ahmed D
>> <[email protected]>wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> It is therefore not possible to run a single or 2 instances
>>> simultaneously?
>>> http://jsfiddle.net/pbnNA/
>>> I tried on my computer using 'chain' but queries executed one after
>>> another.
>>> My plan is to run a script in the background without blocking users
>>> when recharging pages (XHR).
>>
>>> ..? Thank you
>>
>>> On Aug 8, 8:02 pm, Sid-ahmed D <[email protected]> wrote:
>>>> Thank you for your responses.
>>
>>>> I *should* --> i would :)
>>
>>>> On Aug 8, 7:36 pm, Philip Thompson <[email protected]> wrote:
>>
>>>>> On Mon, Aug 8, 2011 at 12:25 PM, Aaron Newton <[email protected]>
>>> wrote:
>>>>>> On Mon, Aug 8, 2011 at 10:21 AM, Philip Thompson <
>>> [email protected]>wrote:
>>
>>>>>>> They *should* run simultaneously as you have it. You do have the
>>> "link"
>>>>>>> set to "chain" (one request after another), but I believe this only
>>> acts on
>>>>>>> requests using the same object (however, I may be wrong about this).
>>
>>>>>> You are correct here. The link value is only used if you have a
>>> single
>>>>>> request instance that has .send invoked more than once.
>>
>>>>> Here's a fiddle showing the 3 types of links. They work as expected...
>>
>>>>> http://jsfiddle.net/philthathril/WW8SR/1/
>>
>>>>> Hope that helps to explain a little.
>>
>>>>> ~Philip
>>
>>>>> --http://lonestarlightandsound.com/
>>
>> --http://lonestarlightandsound.com/