| 175 | finished(false) {} |
| 176 | |
| 177 | void Purge() { |
| 178 | // This might be called by an original callback (if the source iterator fails or |
| 179 | // ends) or by a mapped callback (if the map function fails or ends prematurely). |
| 180 | // Either way it should only be called once and after finished is set so there is no |
| 181 | // need to guard access to `waiting_jobs`. |
| 182 | while (!waiting_jobs.empty()) { |
| 183 | waiting_jobs.front().MarkFinished(IterationTraits<V>::End()); |
| 184 | waiting_jobs.pop_front(); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | AsyncGenerator<T> source; |
| 189 | std::function<Future<V>(const T&)> map; |
no test coverage detected