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

Function BackgroundAsyncVectorIt

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

Yields items with a small pause between each one from a background thread

Source from the content-addressed store, hash-verified

56
57// Yields items with a small pause between each one from a background thread
58std::function<Future<TestInt>()> BackgroundAsyncVectorIt(
59 std::vector<TestInt> v, bool sleep = true, int max_q = kDefaultBackgroundMaxQ,
60 int q_restart = kDefaultBackgroundQRestart) {
61 auto pool = internal::GetCpuThreadPool();
62 auto slow_iterator = PossiblySlowVectorIt(v, sleep);
63 EXPECT_OK_AND_ASSIGN(
64 auto background,
65 MakeBackgroundGenerator<TestInt>(std::move(slow_iterator), pool, max_q, q_restart));
66 return MakeTransferredGenerator(background, pool);
67}
68
69std::function<Future<TestInt>()> NewBackgroundAsyncVectorIt(std::vector<TestInt> v,
70 bool sleep = true) {

Callers 2

TESTFunction · 0.85
MakeMethod · 0.85

Calls 3

GetCpuThreadPoolFunction · 0.85
PossiblySlowVectorItFunction · 0.85
MakeTransferredGeneratorFunction · 0.85

Tested by

no test coverage detected