3 ms·
This is clever, otherwise you have to coordinate your cache setter and your async function call between potentially many concurrent calls. There are ways to do
by abuckenheimer 4y ago
This is clever, otherwise you have to coordinate your cache setter and your async function call between potentially many concurrent calls. There are ways to do this coordination though, one implementation I've borrowed in practice in python is modes stampede decorator: https://github.com/ask/mode/blob/master/mode/utils/futures.py#L70 https://github.com/ask/mode/blob/master/mode/utils/futures.p...