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

Function MakeJittery

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

Source from the content-addressed store, hash-verified

40
41template <typename T>
42AsyncGenerator<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
55std::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