akkudoktoreos.core.cache.cachemethod_until_update
- akkudoktoreos.core.cache.cachemethod_until_update(method: TCallable) TCallable
Decorator for in memory caching the result of an instance method.
This decorator caches the method’s result in CacheUntilUpdateStore, ensuring that subsequent calls with the same arguments return the cached result until the next EMS update cycle.
- Parameters:
method (Callable) – The instance method to be decorated.
- Returns:
The wrapped method with caching functionality.
- Return type:
Callable
Example
>>> class MyClass: >>> @cachemethod_until_update >>> def expensive_method(self, param: str) -> str: >>> # Perform expensive computation >>> return f"Computed {param}"