with_friend(uri)
public
Given the uri of another host executes the block provided.
Show source
def self.with_friend(uri)
friend = DRb.fetch_server(uri)
return yield() unless friend
save = Thread.current['DRb']
Thread.current['DRb'] = { 'server' => friend }
return yield
ensure
Thread.current['DRb'] = save if friend
end