Skip to content

wazazaby/inflight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inflight

CI Go Reference Go Report Card MIT License

Package inflight provides a duplicate function call suppression mechanism.

It allows multiple concurrent callers for the same key to share the result of a single function execution, reducing redundant work and resource usage.

All types in this package are safe for concurrent use by multiple goroutines.

Very similar to x/sync/singleflight, but supporting generics and using a more lightweight API (only Group.Do & Group.Forget).

It is also lock-free, if that matters (although sync.OnceValues and sync.Map use mutex internally so..).

Dependencies

The package has two dependencies :

  • github.com/go4org/hashtriemap which is the internal, generic, implementation of sync.Map exposed in a repository by @bradfitz (with all the internal code removed/replaced). It only depends on the standard library internaly.
  • github.com/stretchr/testify for tests

About

Package inflight provides a duplicate function call suppression mechanism.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages