paleolimbot commented on code in PR #416:
URL: https://github.com/apache/arrow-adbc/pull/416#discussion_r1117203438


##########
rust/src/driver_manager.rs:
##########
@@ -0,0 +1,892 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Load and use ADBC drivers.
+//!
+//! ## Loading a driver
+//!
+//! Drivers are initialized using a function provided by the driver as a main
+//! entrypoint, canonically called `AdbcDriverInit`. (Although many will use a
+//! different name to support statically linking multiple drivers within the
+//! same program.)
+//!
+//! To load from a function, use [AdbcDriver::load_from_init].
+//!
+//! To load from a dynamic library, use [AdbcDriver::load].
+//!
+//! ## Using across threads
+//!
+//! [AdbcDriver] and [AdbcDatabase] can be used across multiple threads. They
+//! hold their inner implementations within [std::sync::Arc], so they are
+//! cheaply copy-able.
+//!
+//! [AdbcConnection] should not be used across multiple threads. Driver
+//! implementations do not guarantee connection APIs are safe to call from
+//! multiple threads, unless calls are carefully sequenced. So instead of using
+//! the same connection across multiple threads, create a connection for each
+//! thread. [AdbcConnectionBuilder] is [core::marker::Send], so it can be moved
+//! to a new thread before initialized into an [AdbcConnection]. 
[AdbcConnection]
+//! holds it's inner data in a [std::rc::Rc], so it is also cheaply copyable.

Review Comment:
   I thought about this in the R package too. In the Arrow R package we always 
execute "cancellable arrow stuff" on another thread (via an Executor) and wait 
for that future to complete. That relies on Arrow's async API and cancellation 
signal handlers, but it would be a huge asset for the driver manager to handle 
this (nothing worse than accidentally executing a huge query without the 
ability to cancel).



-- 
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