A
Aaron Turner
I have the following code:
class Server
def start_reaper
@reaper = Thread.new do
loop do
sleep 10
self.clean_workers
puts "cleaned up"
end
end
end
# other stuff goes here...
end
server = Server.new
DRb.start_service(nil, server)
server.start_reaper
DRb.thread.join
The problem is that it seems that the loop, well doesn't loop. It
looks like the thread goes to sleep after one iteration and doesn't
wake up based on the number of times "cleaned up" is printed.
Suggestions?
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing & replay tools for Unix
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -- Benjamin Franklin
class Server
def start_reaper
@reaper = Thread.new do
loop do
sleep 10
self.clean_workers
puts "cleaned up"
end
end
end
# other stuff goes here...
end
server = Server.new
DRb.start_service(nil, server)
server.start_reaper
DRb.thread.join
The problem is that it seems that the loop, well doesn't loop. It
looks like the thread goes to sleep after one iteration and doesn't
wake up based on the number of times "cleaned up" is printed.
Suggestions?
--
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing & replay tools for Unix
They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety. -- Benjamin Franklin