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

Function CreateAsyncDeviceStreamHandler

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

Source from the content-addressed store, hash-verified

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