From: Ezra Zygmuntowicz Date: 2006-09-24T13:28:29+09:00 Subject: Re: [ANN] slave-0.2.0 On Sep 23, 2006, at 3:52 PM, ara.t.howard@noaa.gov wrote: > > SYNOPSIS > > the Slave class forks a process and starts a drb server in the > child using > any object as the server. the process is detached so it is not > required > (nor possible) to wait on the child pid. a Heartbeat is set up > between the > parent and child processes so that the child will exit of the > parent exits > for any reason - preventing orphaned slaves from running > indefinitely. the > purpose of Slaves is to be able to easily set up a collection of > objects > communicating via drb protocols instead of having to use IPC. > > > > -a This is a great library Ara, I am writing a library that wraps up the slave lib into another interface for controlling jobs with timers and a few other things. So the master process holds a thread pool with references to slave classes in it so that you can set a limit on the number of running slaves. Using it to offload jobs from a rails app to not hold up the http flow. I have a question though. What would be the cleanest way to have a slave class signal that it is finished working and needs to be kill'ed. I know there is the shutdown method that you could call from the master process to shutdown a slave. But is there something similar that can be called from a slave process? Or should I just let the slave process exit! and let the heartbeat cleanup after the dead slaves? Thanks -Ezra