HubClient.GetProxyAsync<T> 方法

定义

通过客户端代理请求访问某些服务。

public System.Threading.Tasks.ValueTask<T> GetProxyAsync<T> (Microsoft.ServiceHub.Framework.ServiceRpcDescriptor serviceDescriptor, Microsoft.ServiceHub.Framework.ServiceActivationOptions options = default, System.Threading.CancellationToken cancellationToken = default) where T : class;
public System.Threading.Tasks.ValueTask<T?> GetProxyAsync<T> (Microsoft.ServiceHub.Framework.ServiceRpcDescriptor serviceDescriptor, Microsoft.ServiceHub.Framework.ServiceActivationOptions options = default, System.Threading.CancellationToken cancellationToken = default) where T : class;
abstract member GetProxyAsync : Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * Microsoft.ServiceHub.Framework.ServiceActivationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'T (requires 'T : null)> (requires 'T : null)
override this.GetProxyAsync : Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * Microsoft.ServiceHub.Framework.ServiceActivationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'T (requires 'T : null)> (requires 'T : null)
Public Function GetProxyAsync(Of T As Class) (serviceDescriptor As ServiceRpcDescriptor, Optional options As ServiceActivationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of T)

类型参数

T

要创建的客户端代理的类型。

参数

serviceDescriptor
ServiceRpcDescriptor

服务的描述符。

options
ServiceActivationOptions

其他选项可更改服务的激活方式,或向服务构造函数提供其他数据。

cancellationToken
CancellationToken

取消标记。

返回

可用于与服务通信的客户端代理;如果找不到匹配的服务,则为 。null 如果返回的实例实现 IDisposable,则不再需要时,应释放该属性。

实现

适用于