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
proposal: x/sync/singleflight: add generic version #53427
Comments
bradfitz
added a commit
to tailscale/tailscale
that referenced
this issue
Jun 17, 2022
Forked from golang.org/x/sync/singleflight at the x/sync repo's commit 67f06af15bc961c363a7260195bcd53487529a21 Updates golang/go#53427 Change-Id: Iec2b47b7777940017bb9b3db9bd7d93ba4a2e394 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
bradfitz
added a commit
to tailscale/tailscale
that referenced
this issue
Jun 17, 2022
Forked from golang.org/x/sync/singleflight at the x/sync repo's commit 67f06af15bc961c363a7260195bcd53487529a21 Updates golang/go#53427 Change-Id: Iec2b47b7777940017bb9b3db9bd7d93ba4a2e394 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
bradfitz
added a commit
to tailscale/tailscale
that referenced
this issue
Jun 17, 2022
Forked from golang.org/x/sync/singleflight at the x/sync repo's commit 67f06af15bc961c363a7260195bcd53487529a21 Updates golang/go#53427 Change-Id: Iec2b47b7777940017bb9b3db9bd7d93ba4a2e394 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
bradfitz
added a commit
to tailscale/tailscale
that referenced
this issue
Jun 17, 2022
Forked from golang.org/x/sync/singleflight at the x/sync repo's commit 67f06af15bc961c363a7260195bcd53487529a21 Updates golang/go#53427 Change-Id: Iec2b47b7777940017bb9b3db9bd7d93ba4a2e394 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
I don't think we have a convention yet. |
What about x/sync/v2/singleflight ? |
twitchyliquid64
pushed a commit
to tailscale/tailscale
that referenced
this issue
Jun 21, 2022
Forked from golang.org/x/sync/singleflight at the x/sync repo's commit 67f06af15bc961c363a7260195bcd53487529a21 Updates golang/go#53427 Change-Id: Iec2b47b7777940017bb9b3db9bd7d93ba4a2e394 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
I tried it before. Thank you. refs: #52520 |
Change https://go.dev/cl/425187 mentions this issue: |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The singleflight package's
Group
type usesstring
keys andinterface{}
values:https://pkg.go.dev/golang.org/x/sync/singleflight#Group
I've locally forked it to add generics
[K comparable, V any]
but I'd like to get it upstream instead.Proposal: add
singleflight.TypedGroup[K, V]
orsingleflight.GenericGroup[K, V]
orsingleflight.GroupOf[K, V]
behind ago1.18
build tag.Do we have a convention yet on naming new parallel generic types alongside others?
Related: #47657 (for PoolOf, MapOf). (There was also talk of default type parameters so old code could instantiate types and get the old behavior (in this case
[string, any]
) and new callers could specify types?)The text was updated successfully, but these errors were encountered: