Sha256: e9719323493093221e44724a3d7af5f79d3614d9fe0f139cccc64f776fcd9e31

Contents?: true

Size: 809 Bytes

Versions: 10

Compression:

Stored size: 809 Bytes

Contents

# Copyright (c) 2012 by Tracelytics, Inc.
# All rights reserved.
#
module Oboe
  module API
    module Memcache
      MEMCACHE_OPS = %w{add append cas decr decrement delete fetch get get_multi incr increment prepend replace set}

      def memcache_hit?(result)
        result.nil? ? 0 : 1
      end

      def remote_host(key)
        return unless defined?(Lib.memcached_server_by_key)\
          and defined?(@struct) and defined?(is_unix_socket?)

        server_as_array = Lib.memcached_server_by_key(@struct, args[0].to_s)
        if server_as_array.is_a?(Array)
          server = server_as_array.first
          if is_unix_socket?(server)
            return "localhost"
          elsif defined?(server.hostname)
            return server.hostname
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
oboe-1.3.9.1 lib/oboe/api/memcache.rb
oboe-1.3.8 lib/oboe/api/memcache.rb
oboe-1.3.0 lib/oboe/api/memcache.rb
oboe-1.3.1 lib/oboe/api/memcache.rb
oboe-1.3.2 lib/oboe/api/memcache.rb
oboe-1.3.3 lib/oboe/api/memcache.rb
oboe-1.3.4 lib/oboe/api/memcache.rb
oboe-1.3.5 lib/oboe/api/memcache.rb
oboe-1.3.6 lib/oboe/api/memcache.rb
oboe-1.3.7 lib/oboe/api/memcache.rb