mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-27 13:10:37 +08:00
Client channel: pool the state machine of SendRequestAsync
Every request allocated the async state machine box of UaSCUaBinaryClientChannel.SendRequestAsync (~170 B). On .NET 6 and later it uses PoolingAsyncValueTaskMethodBuilder, like the transport's send and receive; the callers await the returned task once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4528d04676
commit
41859b64a3
@@ -358,6 +358,14 @@ namespace Opc.Ua.Bindings
|
||||
/// <exception cref="ArgumentNullException"><paramref name="request"/> is <c>null</c>.</exception>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
/// <exception cref="ServiceResultException"></exception>
|
||||
/// <remarks>
|
||||
/// The state machine of a request is pooled, so the returned task must be awaited
|
||||
/// once, like any value task.
|
||||
/// </remarks>
|
||||
#if NET6_0_OR_GREATER
|
||||
[System.Runtime.CompilerServices.AsyncMethodBuilder(
|
||||
typeof(System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder<>))]
|
||||
#endif
|
||||
public async ValueTask<IServiceResponse> SendRequestAsync(
|
||||
IServiceRequest request,
|
||||
int timeout,
|
||||
|
||||
Reference in New Issue
Block a user