[Twisted-Python] In memory cache in twisted

meejah meejah at meejah.ca
Fri Sep 27 08:56:22 MDT 2019


Waqar Khan <wk80333 at 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




More information about the Twisted-Python mailing list