Run factory for key at most once at a time: concurrent calls share the in-flight promise, so a cold key is never computed twice under a burst (cache stampede / dogpile protection).
factory
key
The shared in-flight map.
The cache key.
The value producer.
The produced value.
Run
factoryforkeyat most once at a time: concurrent calls share the in-flight promise, so a cold key is never computed twice under a burst (cache stampede / dogpile protection).