public Method

MemCache.get(key, raw = false)

Retrieves key from memcache. If raw is false, the value will be unmarshalled.

Source Code

# File active_support/vendor/memcache-client-1.5.0/memcache.rb, line 230
def get(key, raw = false)
  server, cache_key = request_setup key

  value = if @multithread then
            threadsafe_cache_get server, cache_key
          else
            cache_get server, cache_key
          end

  return nil if value.nil?

  value = Marshal.load value unless raw

  return value
rescue TypeError, SocketError, SystemCallError, IOError => err
  handle_error server, err
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.