Conversation
|
This PR (HEAD: 8fa636b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/sync/+/444215 to see it. Tip: You can toggle comments from me using the |
|
Message from Bryan Mills: Patch Set 1: Hold+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/444215. |
|
Message from Leo Antunes: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/444215. |
|
Moved to draft while proposal is active. |
|
Message from Leo Antunes: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/444215. |
This PR is an alternative to the proposal in #9, inspired by @bcmills' comment.
The general idea is to add a second function argument to
Do, which is guaranteed to be called by all goroutines waiting on a singleflight before the singleflighted call returns. It complements the existing function argument so that writing code that must be called in all cases becomes trivial.Some refactoring to reduce code duplication could also be done, but I wanted to get some first working version out to kickstart a discussion.
Names are of course up for bikeshedding.
WDYT?