happyly.caching.mixins.CacheByRequestIdMixin¶
-
class
happyly.caching.mixins.
CacheByRequestIdMixin
(cacher)¶ Bases:
object
Mixin which adds caching functionality to Listener. Utilizes notions of listener’s topic and request id of message – otherwise will not work.
To be used via multiple inheritance. For example, given some component
SomeListener
you can define its caching equivalent by definingSomeCachedListener
which inherits from bothSomeListener
andCacheByRequestIdMixin
.on_deserialization_failed
(message, error)on_published
(original_message, …)on_received
(message)