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

Function IterateSynchronously

cpp/src/arrow/util/thread_pool.h:609–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607/// calls.
608template <typename T>
609Iterator<T> IterateSynchronously(
610 FnOnce<Result<std::function<Future<T>()>>(Executor*)> get_gen, bool use_threads,
611 Executor* executor) {
612 if (use_threads) {
613 auto used_executor = executor != NULLPTR ? executor : GetCpuThreadPool();
614 auto maybe_gen = std::move(get_gen)(used_executor);
615 if (!maybe_gen.ok()) {
616 return MakeErrorIterator<T>(maybe_gen.status());
617 }
618 return MakeGeneratorIterator(*maybe_gen);
619 } else {
620 return SerialExecutor::IterateGenerator(std::move(get_gen));
621 }
622}
623
624/// \brief Potentially iterate an async generator serially (if use_threads is false)
625/// using the default CPU thread pool

Callers

nothing calls this directly

Calls 5

GetCpuThreadPoolFunction · 0.85
MakeGeneratorIteratorFunction · 0.85
IterateGeneratorFunction · 0.85
okMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected