From: Daniel Nugent Date: 2006-02-22T04:01:30+09:00 Subject: Re: [ANN] lazy.rb 0.9.5 -- transparent futures! I must've misread the code (or misunderstood something).... Yep. Thought the rescue clause raised the exception out of the thread instead of just storing it. In that case, what I want (I'm so damn greedy :D) is to be able to raise the exception immediately (in a case where you damned well know that you're going to need the value and would prefer to fail early) and I see that that's trivial to implement (just have a conditional toss the exception up in the thread if some @raise_immediately flag is set to true). There's one other thing I was wondering about: What's the prudency of adding a method to Future to allow the Future to go back to sleep (release the lock, pass the thread)? In this case, I'm considering waiting for a resource that some other future/thread might be using, or waiting for a port to get some data. (mostly implementation details for that library I mentioned, I'll deal with them, but I'm curious if there's any issue I'm forgetting). On 2/21/06, MenTaLguY wrote: > On Tue, 2006-02-21 at 16:00 +0900, Daniel Nugent wrote: > > One question: How hard would it be to modify the way that exceptions > > are handled to hold off raising the exception until the result was > > requested? I'm thinking specifically of some non-deterministic > > situations where you may request a value but never end up needing to > > use it. > > Hmm, if it doesn't already do that, it's a bug. > > Can you give me a test case which demonstrates the problem? > > -mental > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQBD+1uMSuZBmZzm14ERAj4HAKDRRv4oplZVejcfLDJ6k7x8Ovcl+wCgiSbz > G6QQwTFxw+EQTR3g9/oGjJ8= > =vqXa > -----END PGP SIGNATURE----- > > > -- -Dan Nugent