On Tue, 12 Dec 2006, Clark Snowdall wrote:

> Hello all,
>
> I am developing a SOAP server running on a Windows XP machine.  When
> contacted from the outside, it will launch a windows executable at the
> command line.  The problem is this executable takes a long time.  When I
> would block on the SOAP call I would get a time out error on the client
> end, as one would expect.
>
> So when I put the command in a thread it would still cause a timeout
> even though it would pass the point of executing the command line app.
> It still seems that the method inside the SOAP::RPC::StandaloneServer
> blocks until all the threads clear.
>
> I've also tried using the windows "start" command to kick this thing
> off.  But again, the method blocks until the windows app finishes.
>
> I also tried using exec("my_app.exe") if fork.nil?  In that case the
> SOAP meothd returns to the client but the windows app is prematurely cut
> off before finishing.
>
> Essentially, I need something along the lines of "command &" from unix
> for windows.  Any ideas?
>
> Thanks in advance,
> Snowdall

   require 'rubygems'
   require 'systemu'  # gem install systemu

   cmd = 'your.app'

   t = Thread.new{ systemu cmd } # run in background

   # stuff

   status, stdout, stderr = t.value # get info later iff needed


regards.

-a
-- 
if you want others to be happy, practice compassion.
if you want to be happy, practice compassion.  -- the dalai lama