From: Thiago Jackiw Date: 2007-01-11T08:23:06+09:00 Subject: Re: Threading nightmare Tim, I'm on a unix box but I'm trying to accomplish this without having to be system specific. If I have no choice than I'll have to do it only for *nix systems. Thiago On 1/10/07, Tim Pease wrote: > On 1/10/07, Thiago Jackiw wrote: > > The scenario (for test purposes) I'm trying to accomplish when running > > rake on a new Rakefile is: > > > > 1) start a java server (which doesn't have an option to 'daemonize' > > it) and get its pid > > 2) interact with the server by sending things or accessing it > > 3) stop the server > > > > I've tried using IO's popen, fork, thread, even sending the server to > > /dev/null when starting it but none of them work as I expected. Once > > the server (step 1) starts it just hangs in there, not letting the > > following steps to run. But if I kill the server (control+c) the step > > 2 tries to run and fails because the server is no longer running. > > > > If you're on a non-Windows system, then you can use Ara's "slave" gem. > > Check out Ara's "systemu" gem as well -- although I do not think it > allows you to send information to the forked process. > > Blessings, > TwP > >