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

Function CreateAsyncDeviceStreamHandler

cpp/src/arrow/c/bridge.cc:2817–2832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2815} // namespace
2816
2817Future<AsyncRecordBatchGenerator> CreateAsyncDeviceStreamHandler(
2818 struct ArrowAsyncDeviceStreamHandler* handler, internal::Executor* executor,
2819 uint64_t queue_size, DeviceMemoryMapper mapper) {
2820 auto iterator =
2821 std::make_shared<AsyncRecordBatchIterator>(queue_size, std::move(mapper));
2822 return AsyncRecordBatchIterator::Make(*iterator, handler)
2823 .Then([executor](std::shared_ptr<AsyncRecordBatchIterator::State> state)
2824 -> Result<AsyncRecordBatchGenerator> {
2825 AsyncRecordBatchGenerator gen{state->schema_, state->device_type_, nullptr};
2826 auto it =
2827 Iterator<RecordBatchWithMetadata>(AsyncRecordBatchIterator{std::move(state)});
2828 ARROW_ASSIGN_OR_RAISE(gen.generator,
2829 MakeBackgroundGenerator(std::move(it), executor));
2830 return gen;
2831 });
2832}
2833
2834Future<> ExportAsyncRecordBatchReader(
2835 std::shared_ptr<Schema> schema,

Callers 1

TEST_FFunction · 0.85

Calls 4

MakeBackgroundGeneratorFunction · 0.85
ThenMethod · 0.80
MakeFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50

Tested by 1

TEST_FFunction · 0.68