From: Nikodemus Siivola Date: 2002-05-10T07:34:18+09:00 Subject: Re: timeout.rb problem On Fri, 10 May 2002 wconrad@yagni.com wrote: > It seems like a design problem. In the code you showed us, the > contract of medidate is that a timeout causes it to print a message > and exit. I can't imagine how the outer rescue should catch a timeout > that is being consumed by the medidate method. What am I missing? In the example my _intended_ contract with meditate: to sit quietly doing nothing, and after ten seconds print a message and exit. My intended contract with the timeout: to excute the block I gave it and return the control to my rescue block if it takes too long. Yes, the design is flawed and the actual contract is as you say, but can you see the _intention_ of the method? I wanted to do a timeout on a potentially infinite operation, but ended up rescuing all the timeouts in the system! Not nice. From personal experience I can assure you that this behavior can lead to some very hairy debugging... -- Nikodemus