MCPcopy Create free account
hub / github.com/apache/arrow / MakeJittery

Function MakeJittery

cpp/src/arrow/util/async_generator_test.cc:45–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

TESTFunction · 0.85

Calls 4

MakeMappedGeneratorFunction · 0.85
SleepMethod · 0.80
MakeFunction · 0.70
MarkFinishedMethod · 0.45

Tested by

no test coverage detected