Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid parallel running a load function for the same key #242 #243

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

advoretsky
Copy link
Contributor

@advoretsky advoretsky commented Apr 7, 2024

used https://pkg.go.dev/golang.org/x/sync/singleflight to avoid parallel running of the loading function.
modified test to check the new behavior

@shotmk
Copy link

shotmk commented Apr 7, 2024

Very anticipated improvement. Please review.

Copy link
Owner

@eko eko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work on this subject @advoretsky!

lib/cache/loadable.go Outdated Show resolved Hide resolved
lib/cache/loadable.go Outdated Show resolved Hide resolved
advoretsky and others added 2 commits April 16, 2024 11:45
Co-authored-by: Vincent Composieux <vincent.composieux@gmail.com>
Co-authored-by: Vincent Composieux <vincent.composieux@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants