From: Robert Klemme Date: 2009-11-26T18:16:43+09:00 Subject: Re: DRb::DRbObject.alive? 2009/11/25 Benoit Daloze : > Yeah, you're right. > > So here's how I did to not duplicate the code: > >     def try_on_clients >        @clients.each { |client| >            begin >                yield client >            rescue DRb::DRbConnError >                del_drb_client(client) >            end >        } >    end > >    def receive_message(msg) >        try_on_clients { |client| client.show_message(msg) } >    end > > That looks already more beautiful, and doesn't spend time looking if alive. > Anyway, it's a little too bad for the client, because any connection error > will drop him away, but he can reconnect easily. Well, you could place them in a closed list (or queue) or even return the array of closed / removed clients. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/