Cache heavy computation functions with a timeout value
Traditional lru_cache
from functools import lru_cache
from time import sleep
@lru_cache
def heavy_computation_function(*args):
sleep(25) # to mimic heavy computation
computed_value = 12345
return computed_value
Limitation
lru_cache yo...
soumendrak.hashnode.dev3 min read