janos / singleflight

Duplicate function call suppression with context

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Singleflight

GoDoc Go

Package singleflight provides a duplicate function call suppression mechanism similar to golang.org/x/sync/singleflight but with:

  • support for context cancelation. The context passed to the callback function is a context that preserves all values from the passed context but is cancelled by the singleflight only when all awaiting caller's contexts are cancelled.
  • support for generics.

Installation

Run go get resenje.org/singleflight from command line.

About

Duplicate function call suppression with context

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%