Therefore … is there any need to complicate things by using
backgroundrb in this scenario?
Or am I missing some major advantage using backgroundrb, or some major
disadvantage using a regular AJAX call?
Backgroundrb will release the thread, while a normal AJAX request
where you wait for a response will block one of your server
connections. This will be the best way to go btw, as your subsequent
AJAX calls will only take a few fractions of a second to query the
Backgroundrb process, then release the thread for other users.
To illustrate: suppose you’re running a mongrel cluster of 5 mongrels
and you have 5 people making such a long running task at the same
time, all mongrels will be in use and no one will be able to connect
to your site anymore if you use a normal AJAX request which waits for
a server response.
Ah right. Yes - now I see the advantage of using backgroundrb …
Thanks!
Peter De Berdt wrote:
To illustrate: suppose you’re running a mongrel cluster of 5 mongrels
and you have 5 people making such a long running task at the same
time, all mongrels will be in use and no one will be able to connect
to your site anymore if you use a normal AJAX request which waits for
a server response.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.