akkudoktoreos.core.cache.cache_until_update

akkudoktoreos.core.cache.cache_until_update(func: TCallable) TCallable

Decorator for in memory caching the result of a standalone function.

This decorator caches the function’s result in CacheUntilUpdateStore, ensuring that subsequent calls with the same arguments return the cached result until the next EMS update cycle.

Parameters:

func (Callable) – The function to be decorated.

Returns:

The wrapped function with caching functionality.

Return type:

Callable

Example

>>> @cache_until_next_update
>>> def expensive_function(param: str) -> str:
>>>     # Perform expensive computation
>>>     return f"Computed {param}"