From: mental@... Date: 2006-02-25T03:21:33+09:00 Subject: Re: lazy.rb 0.9.5 -- transparent futures! 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