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

Function BackgroundAsyncVectorIt

cpp/src/arrow/util/async_generator_test.cc:55–64  ·  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

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