Threading nightmare

This is more of a ruby question but I thought I’d give a shot over here
as well.

The scenario (for test purposes) I’m trying to accomplish when running
rake on a new Rakefile is:

  1. start a server and get its pid
  2. run things that sends stuff to the server
  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.

Any ideas how it can be done?

Thanks a lot.

What server are you trying to start? If it is mongrel, perhaps sending
it the -d flag so it starts in daemon mode?

V/r
Anthony

On 1/10/07, Jimmy [email protected] wrote:


Posted via http://www.ruby-forum.com/.


Cell: 808 782-5046
Current Location: Melbourne, FL

Anthony E. wrote:

What server are you trying to start? If it is mongrel, perhaps sending
it the -d flag so it starts in daemon mode?

V/r
Anthony

On 1/10/07, Jimmy [email protected] wrote:


Posted via http://www.ruby-forum.com/.


Cell: 808 782-5046
Current Location: Melbourne, FL

Anthony,

I’m trying to start a java server, which unfortunately doesn’t have the
option to ‘daemonize’ it.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs