orderedFlightGroup allows the caller to force the schedule of when orig.Do will be called. This is useful to serialize calls such that singleflight cannot dedup them.
| 369 | // orig.Do will be called. This is useful to serialize calls such |
| 370 | // that singleflight cannot dedup them. |
| 371 | type orderedFlightGroup struct { |
| 372 | mu sync.Mutex |
| 373 | stage1 chan bool |
| 374 | stage2 chan bool |
| 375 | orig flightGroup |
| 376 | } |
| 377 | |
| 378 | func (g *orderedFlightGroup) Do(key string, fn func() (interface{}, error)) (interface{}, error) { |
| 379 | <-g.stage1 |
nothing calls this directly
no outgoing calls
no test coverage detected