VictoriaMetrics Observability Blog

Filter: Singleflight

Go Singleflight Melts in Your Code, Not in Your DB

What singleflight does is ensure that only one of those goroutines actually runs the operation, like getting the data from the database. It allows only one ‘in-flight’ (ongoing) operation for the same piece of data (known as a ‘key’) at any given moment.