Skip to content

exaring/contextflight

Repository files navigation

CI status Go Report Card

contextflight

contextflight is a thin wrapper around singleflight that adds context handling.

It works like singleflight, with the addition that the provided function receives a context.Context, which will be cancelled when all waiting callers' contexts are cancelled.

This allows for correctly cancelling an expensive operation inside of singleflight only when all requesters have canceled their requests.

About

singleflight wrapper supporting contexts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages