| 40 | |
| 41 | template <typename T> |
| 42 | AsyncGenerator<T> MakeJittery(AsyncGenerator<T> source) { |
| 43 | auto latency_generator = arrow::io::LatencyGenerator::Make(0.01); |
| 44 | return MakeMappedGenerator(std::move(source), [latency_generator](const T& res) { |
| 45 | auto out = Future<T>::Make(); |
| 46 | std::thread([out, res, latency_generator]() mutable { |
| 47 | latency_generator->Sleep(); |
| 48 | out.MarkFinished(res); |
| 49 | }).detach(); |
| 50 | return out; |
| 51 | }); |
| 52 | } |
| 53 | |
| 54 | // Yields items with a small pause between each one from a background thread |
| 55 | std::function<Future<TestInt>()> BackgroundAsyncVectorIt( |
no test coverage detected