Sha256: b91b238fe3445a75d319dd1f128ec20125698b6d754bbe1143a67e8da91d4781

Contents?: true

Size: 437 Bytes

Versions: 2

Compression:

Stored size: 437 Bytes

Contents

module CassandraThrift
  module Cassandra
    class SafeClient  
      def initialize(client, transport)
        @client = client 
        @transport = transport
      end
      
      def method_missing(*args)
        @client.send(*args)
      rescue IOError, UnavailableException
        @transport.close rescue nil
        @transport.open
        raise if defined?(once)
        once = true
        retry
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
slillibri-cassandra-0.4 lib/cassandra/safe_client.rb
cassandra-0.4 lib/cassandra/safe_client.rb