Sept. 27, 2019
2:56 p.m.
Waqar Khan <wk80333@gmail.com> writes:
But, is the above way of using dictionary as cache correct? Or is there a "deffered" way of doing this? All I want is an inmemory cache that is compatible with this async paradigm?
Yes, it is fine to use a single dict as a cache. Twisted is single-threaded an so only one callback is running at a time. There's no need to lock etc. (Or, is there another reason you need to cache to "be async"? Like maybe it's using memcached or so?) -- meejah