| 607 | /// calls. |
| 608 | template <typename T> |
| 609 | Iterator<T> IterateSynchronously( |
| 610 | FnOnce<Result<std::function<Future<T>()>>(Executor*)> get_gen, bool use_threads, |
| 611 | Executor* executor) { |
| 612 | if (use_threads) { |
| 613 | auto used_executor = executor != NULLPTR ? executor : GetCpuThreadPool(); |
| 614 | auto maybe_gen = std::move(get_gen)(used_executor); |
| 615 | if (!maybe_gen.ok()) { |
| 616 | return MakeErrorIterator<T>(maybe_gen.status()); |
| 617 | } |
| 618 | return MakeGeneratorIterator(*maybe_gen); |
| 619 | } else { |
| 620 | return SerialExecutor::IterateGenerator(std::move(get_gen)); |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | /// \brief Potentially iterate an async generator serially (if use_threads is false) |
| 625 | /// using the default CPU thread pool |
nothing calls this directly
no test coverage detected