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

Function CreateAsyncDeviceStreamHandler

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

Source from the content-addressed store, hash-verified

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