CurtHagenlocher commented on code in PR #1865: URL: https://github.com/apache/arrow-adbc/pull/1865#discussion_r1605603222
########## csharp/src/Apache.Arrow.Adbc/AdbcConnection11.cs: ########## @@ -0,0 +1,426 @@ +/* + * 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. + */ + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Apache.Arrow.Ipc; + +namespace Apache.Arrow.Adbc +{ + /// <summary> + /// Provides methods for query execution, managing prepared statements, + /// using transactions, and so on. + /// </summary> + public abstract class AdbcConnection11 : IDisposable +#if NET5_0_OR_GREATER + , IAsyncDisposable +#endif + { + ~AdbcConnection11() => Dispose(false); + + /// <summary> + /// Attempts to cancel an in-progress operation on a connection. + /// </summary> + /// <remarks> + /// This can be called during a method like GetObjects or while consuming an ArrowArrayStream + /// returned from such. Calling this function should make the other function throw a cancellation exception. + /// + /// This must always be thread-safe. + /// </remarks> + public virtual void Cancel() Review Comment: Cancel is what you call when you're using the synchronous API. This already has to be on another thread because the synchronous API for e.g. ExecuteQuery will block the thread it's called from. If you're using the asynchronous API, then you should use the cancellation token instead of calling this method. -- 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]
