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

util/singleflight: add DoChanContext #12003

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrew-d
Copy link
Member

@andrew-d andrew-d commented May 4, 2024

This is a variant of DoChan that supports context propagation, such that the context provided to the inner function will only be canceled when there are no more waiters for a given key. This can be used to deduplicate expensive and cancelable calls among multiple callers safely.

Updates #11935

Change-Id: Ibe1fb67442a854babbc6924fd8437b02cc9e7bcf

This is a variant of DoChan that supports context propagation, such that
the context provided to the inner function will only be canceled when
there are no more waiters for a given key. This can be used to
deduplicate expensive and cancelable calls among multiple callers
safely.

Updates #11935

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: Ibe1fb67442a854babbc6924fd8437b02cc9e7bcf
@andrew-d andrew-d force-pushed the andrew/singleflight-context branch from bde2a05 to 36e0841 Compare May 7, 2024 22:13
@andrew-d andrew-d requested review from bradfitz and maisem May 7, 2024 22:14
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.

None yet

1 participant