views:

245

answers:

2

Is there any way to make non-blocking SOAP requests within EventMachine?

I'm creating a ruby application which interacts with the google adwords api (which is SOAP based), using the adwords4r gem. The application uses EM to receive messages over a stomp connection, and then processes those messages by making SOAP calls to the adwords api. Obviously I need those calls to be non-blocking, since the processing will be within the reactor thread. One option would be to use EM.defer, but I'd rather not have the overhead of a bunch of threads in a threadpool.

A: 

After earning a tumbleweed badge with this question I ended up asking on the #eventmachine IRC. Apparently there is no eventmachine-friendly options for making SOAP calls, besides using EM.defer

Pete Hodgson
I'm interested - what was wrong with HandSoap?
tomtaylor
I'd guess it's just that no-one in the #eventmachine chat room knew about it when I asked. I should probably change the accepted answer for this question.
Pete Hodgson
+1  A: 

HandSoap can use EventMachine.

troelskn
Thanks, I'll check it out.
Pete Hodgson
Yep, looks like HandSoap is the way to go: http://wiki.github.com/unwire/handsoap/async-support. Thanks!
Pete Hodgson