Ok, two things:
Firstly - As demonstrated in the sample application that I attached with the original post, I was using the combination of cache.ram with cache.disk, as my default cache: cache.ram(key, lambda: cache.disk(...), ttl) Secondly, in the scenario where I create instance of CacheInRam, and CacheOnDisk, and use them like so:
cache_ram = CacheInRam()
cache_disk = CacheOnDisk(ONE_CONSTANT_FOLDER)
cache_ram(key, lambda: cache_disk(key, lambda: ..., ttl), ttl)

In the second case, yes the instances are new ones per request ( but this is a scenario I tried when testing my application independent of web2py). Note that it goes to the disk everytime, and all the cache disk instances are referring to the same cache folder. So, in this case, whether it refers to the same cache folder or not, it basically is not sharing the cache data ... is that what you meant? This is the reason why I did not see any contention. Whereas, in this second case, if I were to retain a singleton of cache_disk, then I should be seeing the issue with cache.disk?

________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On Thu, 15-10-2015 8:37 PM, Leonel Câmara wrote:
Ohh wait a minute I thought only cache disk was involved. If you create new instances of CacheRam instead of using the one already provided you are not using the cache at all as the new instances will have an empty cache.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to