(ctx context.Context)
| 136 | } |
| 137 | |
| 138 | func (v *Queue) maybeReportProgress(ctx context.Context) { |
| 139 | if clock.Now().Before(v.nextReportTime) { |
| 140 | return |
| 141 | } |
| 142 | |
| 143 | v.nextReportTime = clock.Now().Add(1 * time.Second) |
| 144 | |
| 145 | v.reportProgress(ctx) |
| 146 | } |
| 147 | |
| 148 | // OnNthCompletion invokes the provided callback once the returned callback function has been invoked exactly n times. |
| 149 | func OnNthCompletion(n int, callback CallbackFunc) CallbackFunc { |