singleflight
A concurrency pattern that coalesces multiple concurrent requests for the same key into a single actual execution, with the remaining callers waiting for and sharing the result. It eliminates duplicate work and reduces load on downstream services.
Timeline (last 90 days)
The Go language standard extension library golang.org/x/sync/singleflight can merge duplicate calls to the same key at the same moment into a single actual execution, with the remaining calls sharing the same result.
singleflight is process-level deduplication, and in multi-instance deployment scenarios it still needs to be combined with distributed locks to achieve cluster-level request merging.
All Facts (2)
The Go language standard extension library golang.org/x/sync/singleflight can merge duplicate calls to the same key at the same moment into a single actual execution, with the remaining calls sharing the same result.
50%Unverifiedsingleflight is process-level deduplication, and in multi-instance deployment scenarios it still needs to be combined with distributed locks to achieve cluster-level request merging.
50%