util/memcache.lua

Sun, 01 Aug 2010 01:23:32 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 01 Aug 2010 01:23:32 +0100
changeset 11
85c18da60925
parent 0
73bc20975514
child 13
db66a09dc0b6
permissions
-rw-r--r--

Fix README header


module("memcache", package.seeall);

function new()
	local cache = {};
	
	local _data = {};
	local _flags = {};
	
	function cache:set(key, flags, expires, data)
		if expires ~= 0 then
			return false, "Expiry is not currently implemented";
		end
		_flags[key] = flags;
		_data[key] = data;
		return true;
	end
	
	function cache:get(key)
		return _flags[key], _data[key];
	end
	
	return cache;
end

return _M;

mercurial