1

I have a rails app which calls a SOAP service inside one of my controllers. The problem is that when the user submits the page and the app sends out the SOAP request, the user ends up having to wait for the SOAP response because the Savon gem is using a blocking call for the SOAP request.

Any idea how to tell Savon to behave asynchronously or tell rails/ruby to make this method call asynchronously?

Thanks!

1 Answers1

0

To send the request asynchronously, you can send the request inside another thread.

You can read more on multithreading here

Dipil
  • 2,628
  • 1
  • 20
  • 25
  • Will this cause problems within Rails? –  Dec 23 '11 at 04:15
  • That shouldn't cause problems but if you are really worried about it then you should look at resque at https://github.com/blog/542-introducing-resque. That will require more setup but works great. – Dipil Dec 23 '11 at 05:49