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 defining SomeCachedListener which inherits from both SomeListener and CacheByRequestIdMixin.

on_deserialization_failed(message, error)

on_published(original_message, …)

on_received(message)