https://github.com/janos/singleflight
Duplicate function call suppression with context
https://github.com/janos/singleflight
context go golang
Last synced: 7 months ago
JSON representation
Duplicate function call suppression with context
- Host: GitHub
- URL: https://github.com/janos/singleflight
- Owner: janos
- License: bsd-3-clause
- Created: 2019-05-02T21:33:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T17:26:16.000Z (9 months ago)
- Last Synced: 2024-11-13T04:03:01.197Z (7 months ago)
- Topics: context, go, golang
- Language: Go
- Size: 25.4 KB
- Stars: 23
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Singleflight
[](https://godoc.org/resenje.org/singleflight)
[](https://github.com/janos/singleflight/actions?query=workflow%3AGo)Package singleflight provides a duplicate function call suppression
mechanism similar to [golang.org/x/sync/singleflight](https://pkg.go.dev/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.