[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

multiple xhr requests

dmatrix00d

7/6/2006 10:12:00 PM

Hi I have a window that looks like this

--------------------
| | Enter
--------------------

That box will take a command that the user enters and runs it on a
server in the background loading a new window for the user to view the
results. Is there a way to take multiple xhr requests so that the next
request the user enters , a new window will pop up right away, instead
of stalling for the first xhr request to finish?

thanks

3 Answers

dmatrix00d

7/6/2006 10:17:00 PM

0

also, i would like some of the commands to go on the same page so not
all of them will be on new windows

Erich Lin wrote:
> Hi I have a window that looks like this
>
> --------------------
> | | Enter
> --------------------
>
> That box will take a command that the user enters and runs it on a
> server in the background loading a new window for the user to view the
> results. Is there a way to take multiple xhr requests so that the next
> request the user enters , a new window will pop up right away, instead
> of stalling for the first xhr request to finish?
>
> thanks

zimba.tm@gmail.com

7/7/2006 7:46:00 AM

0

Dear Lin,

your question is not very clear.

What you want is :
* Build an application, probably in rails (you should have asked on
that list btw).
* Use XmlHttpRequest (the xhr you mention) to submit some complex
operation.
* Operations should be non-blocking and return a value to the emitter.

What you need in your page, is two XHR. One that submits calculations,
and the second that periodically gets the results.

In your controller, you need two methods. "submit" and "response" for
example. Submit launches a new Thread in which it does the
calculations. Once finished, it fills the user's session for example,
or stores it in a class variable. Response looks in the sessions for
the results. Now I'll let you the pleasure of the implementation :-)

Cheers,
zimbatm

dmatrix00d

7/7/2006 1:22:00 PM

0

By multiple, I meant like the user clicks "enter", and then the user
types something else and clicks "enter". I would like thsoe XHR
requests to be handled simultaneously

thanks

zimbatm wrote:
> Dear Lin,
>
> your question is not very clear.
>
> What you want is :
> * Build an application, probably in rails (you should have asked on
> that list btw).
> * Use XmlHttpRequest (the xhr you mention) to submit some complex
> operation.
> * Operations should be non-blocking and return a value to the emitter.
>
> What you need in your page, is two XHR. One that submits calculations,
> and the second that periodically gets the results.
>
> In your controller, you need two methods. "submit" and "response" for
> example. Submit launches a new Thread in which it does the
> calculations. Once finished, it fills the user's session for example,
> or stores it in a class variable. Response looks in the sessions for
> the results. Now I'll let you the pleasure of the implementation :-)
>
> Cheers,
> zimbatm