python threadsafe object cache

前端 未结 6 960
感动是毒
感动是毒 2020-12-29 09:29

I have implemented a python webserver. Each http request spawns a new thread. I have a requirement of caching objects in memory and since its a webserver, I want the cache t

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 10:11

    I'm not sure any of these answers are doing what you want.

    I have a similar problem and I'm using a drop-in replacement for lrucache called cachetools which allows you to pass in a lock to make it a bit safer.

提交回复
热议问题