From: Daniel Nugent Date: 2006-02-26T13:34:26+09:00 Subject: Re: lazy.rb 0.9.5 -- transparent futures! Good idea, thanks! On 2/24/06, mental@rydia.net wrote: > Quoting Daniel Nugent : > > > Mental, could I perchance persuade you to add an optional > > parameter to > > the Future initializer that accepts a block to be run inside the > > rescue clause of the Future's thread? > > > > future(lambda{|exception| lock.synchronize{subscribers.each{|s| > > s.raise(exception)}}}){holy_crap_long_execution} > > How about: > > future { > begin > holy_crap_long_execution > rescue Exception => exception > lock.synchronize do > subscribers.each { |s| s.raise( exception ) } > end > raise > end > } > > ? > > That might be a bit longer, but it seems clearer what's going on. > > -mental > > -- -Dan Nugent