News for hackers. Stuff that matters.
Re:Ask HN: What are some cool but obscure data structures yo... by dragonwriter on Friday July 22, 2022 @01:43PM (#32194855)
> If the original promise fails you're gonna return a cached failure.

In many cases, another near-in-time request would also fail, so returning a cached failure rather than failing separately is probably a good idea (if you need retry logic, you do it within the promise, and you still need only a single instance.)

(If you are in a system with async and parallel computation both available, you can also use this for expensive to compute pure functions of the key.)

There are no comments on this comment yet.