Copilot commented on code in PR #3930:
URL: https://github.com/apache/thrift/pull/3930#discussion_r4109007121


##########
lib/netstd/Thrift/Transport/ITPerCallTransportProvider.cs:
##########
@@ -0,0 +1,35 @@
+// 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.Threading;
+using System.Threading.Tasks;
+
+namespace Thrift.Transport
+{
+    /// <summary>
+    /// Provides a mechanism to create per-call transports for each request.
+    /// </summary>
+    public interface ITPerCallTransportProvider
+    {
+        /// <summary>
+        /// Creates a new call transport for the current request.
+        /// </summary>
+        /// <param name="cancellationToken"></param>
+        /// <returns></returns>
+        ValueTask<TTransport> CreatePerCallTransportAsync(CancellationToken 
cancellationToken = default);

Review Comment:
   Document the ownership of the returned transport. `THttpTransport` keeps 
every created instance in `_perCallTransports` until that instance is disposed, 
and the generated client relies on protocol disposal to release it. A direct 
consumer of this public interface currently has no indication that failing to 
dispose each result retains the transport and its request/response resources 
for the lifetime of the provider.



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