(ctx context.Context)
| 58 | } |
| 59 | |
| 60 | func (mm *importMediator) start(ctx context.Context) { |
| 61 | ctx, cancel := context.WithCancel(ctx) |
| 62 | mm.fillImportEvents(ctx) |
| 63 | // Make sure we cancel everything when we are done, instead of relying on the parent context |
| 64 | // This should unblock pending send to the channel if the capacity was reached and avoid a panic/race when closing. |
| 65 | cancel() |
| 66 | close(mm.importEvents) |
| 67 | } |
| 68 | |
| 69 | // NextImportEvent returns the next ImportEvent, or nil if done. |
| 70 | func (mm *importMediator) NextImportEvent() ImportEvent { |
no test coverage detected