On 24 Jun 2010, at 12:05, William D. wrote:
> I have the following problem: My application contains a mechanism to
> administrate some external services via a SOAP-API. If a user submit a
> SOAP-Request, he is waiting for the SOAP-Response (it''s necessary
to
> show him the response). While this time the Rails application is
> ''blocked'' – another users can''t do anything
parallel. What is the best
> way to avoid this situation (~ to process many requests at one time)?
It depends on the number of simultaneous requests you expect to have
going. If you''re using Passenger, it will spawn new processes when it
needs to, other users will never know about one process being blocked.
The same applies for mongrel cluster etc if you balance correctly.
If you expect a lot of long running processes, you should process them
in the background. There''s several background processing solutions for
Rails, like Nanite (which uses RabbitMQ) etc. What you basically do is
pass on the longrunning method to an external agent and run it
asynchronousle. Once the job is finished, the agent will execute a
callback in your Rails app (which can be anything you would normally
do in a Rails app). It means the user can launch webservice requests,
do something else and then be notified once the result is available.
Best regards
Peter De Berdt
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.