开发者

Caching aspect - how to create key from method name and arguments

I am creating an aspect to appl开发者_如何学Pythony to methods that checks the cache for a return value, and only permits procession onto the logic of the method if the cache is empty or stale.

I need to generate a cache key for the storage of this information that is unique to the method call for a given set of arguments. My initial hunch is to implement a key creation algorithm that takes the qualified method name and appends serialised argument information.

Is there a recognised approach to key creation under these circumstances?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜