Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > multiple xhr requests

Reply
Thread Tools

multiple xhr requests

 
 
Erich Lin
Guest
Posts: n/a
 
      07-06-2006
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

 
Reply With Quote
 
 
 
 
Erich Lin
Guest
Posts: n/a
 
      07-06-2006
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


 
Reply With Quote
 
 
 
 
zimbatm
Guest
Posts: n/a
 
      07-07-2006
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

 
Reply With Quote
 
Erich Lin
Guest
Posts: n/a
 
      07-07-2006
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifying XHR requests / responses?? Preventing bizt Javascript 1 07-10-2009 05:41 PM
single thread JavaScript and callbacks from XHR NeoAlchemy Javascript 3 02-17-2007 04:59 AM
XHR abort(): IE hangs after two aborts. Sri Javascript 0 09-29-2006 05:50 PM
Set document loaded by XHR into Frame Adam Ratcliffe Javascript 0 04-16-2005 03:01 AM
web requests and mobile requests Fernando Arámburu ASP .Net 1 04-08-2005 07:13 PM



Advertisments