add cache_dir - #41
Conversation
There was a problem hiding this comment.
I'd like to add an isinstance(cache_dir, basestring) check before the isdir call but this doesn't seem to behave nicely with RPython. Any suggestions?
There was a problem hiding this comment.
Is basestring really the correct type for paths? I think we should just pick unicode or bytes, whichever is correct, and use that.
alex
commented
Dec 26, 2014
I'd kind of prefer to come up with a better API, e.g. |
20e987a to
903a9e9CompareThere was a problem hiding this comment.
This could be problematic, that is, on Travis in particular.
016f348 to
c7b9e7eComparesn6uv
commented
Jan 2, 2015
Working with the App engine #24 should be relatively simple. Something like the following (totally untested) code should work: classAppEngineCache(object):
VERSION=1def__init__(self, cache_id):
self.cache_id=cache_iddef_get_key(self, grammar_hash):
return"rply-%s-%s-%s"% (self.VERSION, self.cache_id, grammar_hash)
defload(self, grammar_hash):
cache_key=self._get_key(grammar_hash)
memcache.get(cache_key, namespace="rply")
defdump(self, grammar_hash, data):
cache_key=self._get_key(grammar_hash)
memcache.set(cache_key, data, namespace="rply")
cache=AppEngineCache('myid')
ParserGenerator(["VALUE"], cache=cache) |
sn6uv
commented
Jan 15, 2015
This conflicted with my other changes (in docs), so I've rebased on master. I think this is ready now |
caching still occurs when no cache_id is specified but is not persistent between restarts
sn6uv
commented
Feb 1, 2015
Any word on this PR? |
sn6uv
commented
Jun 21, 2015
@alex any updates on this? |
New Cache API