bkietz commented on code in PR #43632:
URL: https://github.com/apache/arrow/pull/43632#discussion_r1718884653


##########
cpp/src/arrow/c/abi.h:
##########
@@ -228,6 +228,65 @@ struct ArrowDeviceArrayStream {
 
 #endif  // ARROW_C_DEVICE_STREAM_INTERFACE
 
+#ifndef ARROW_C_ASYNC_STREAM_INTERFACE
+#define ARROW_C_ASYNC_STREAM_INTERFACE
+
+// Similar to ArrowDeviceArrayStream, except designed for an asynchronous
+// style of interaction. While ArrowDeviceArrayStream provides producer
+// defined callbacks, this is intended to be created by the consumer instead.
+// The consumer passes this handler to the producer, which in turn uses the
+// callbacks to inform the consumer of events in the stream.
+struct ArrowAsyncDeviceStreamHandler {
+  // Handler for receiving a schema. The passed in stream_schema should be
+  // released or moved by the handler (producer is giving ownership of it to
+  // the handler).
+  //
+  // The `extension_param` argument can be null or can be used by a producer

Review Comment:
   The fact that it's `void*` implies that there's out-of-band communication 
between the producer and consumer. For example:
   
   - the consumer is a GUI and the producer is a dataset library
   - the consumer initiates an interaction by passing
     - a query string
     - an `ArrowAsyncDeviceStreamHandler`
     - `ExtensionParamKind::TOTAL_NUMBER_OF_ROWS`
   
   Since the producer received that last argument, it will ensure that 
`extension_param` points to an `int64_t` (or fail, or leave it null to indicate 
that capability is not available, or ...)
   
   Since this scenario already assumes the producer and consumer can 
communicate what the extension parameter should be without recourse to the 
arrow C ABI, it seems odd to give them another more restrictive channel to 
communicate non-arrow objects.
   
   I think this parameter should either be removed as out of scope or replaced 
with something accessible to consumers without out-of-band typeinfo (as 
@paleolimbot suggested, 
[metadata](https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowSchema.metadata)
 would work)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to