ServiceBrokerExtensions.GetProxyAsync Method

Definition

Overloads

GetProxyAsync<T>(IServiceBroker, ServiceJsonRpcDescriptor<T>, CancellationToken)

Requests access to some service through a client proxy.

GetProxyAsync<T>(IServiceBroker, ServiceRpcDescriptor, CancellationToken)

Requests access to some service through a client proxy.

GetProxyAsync<T>(IServiceBroker, ServiceJsonRpcDescriptor<T>, CancellationToken)

Requests access to some service through a client proxy.

C#
public static System.Threading.Tasks.ValueTask<T?> GetProxyAsync<T>(this Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, Microsoft.ServiceHub.Framework.ServiceJsonRpcDescriptor<T> serviceDescriptor, System.Threading.CancellationToken cancellationToken = default) where T : class;

Type Parameters

T

The type of client proxy to create.

Parameters

serviceBroker
IServiceBroker

The service broker.

serviceDescriptor
ServiceJsonRpcDescriptor<T>

An descriptor of the service.

cancellationToken
CancellationToken

A cancellation token.

Returns

The client proxy that may be used to communicate with the service; or null if no matching service could be found. This should be disposed when no longer required if the instance returned implements IDisposable.

Applies to

Visual Studio SDK 2022 a Visual Studio SDK 2019
Produkt Versiounen
Visual Studio SDK 2019, 2022

GetProxyAsync<T>(IServiceBroker, ServiceRpcDescriptor, CancellationToken)

Requests access to some service through a client proxy.

C#
public static System.Threading.Tasks.ValueTask<T?> GetProxyAsync<T>(this Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, Microsoft.ServiceHub.Framework.ServiceRpcDescriptor serviceDescriptor, System.Threading.CancellationToken cancellationToken = default) where T : class;

Type Parameters

T

The type of client proxy to create.

Parameters

serviceBroker
IServiceBroker

The service broker.

serviceDescriptor
ServiceRpcDescriptor

An descriptor of the service.

cancellationToken
CancellationToken

A cancellation token.

Returns

The client proxy that may be used to communicate with the service; or null if no matching service could be found. This should be disposed when no longer required if the instance returned implements IDisposable.

Exceptions

Thrown when a service discovery or activation error occurs.

Applies to

Visual Studio SDK 2022 a Visual Studio SDK 2019
Produkt Versiounen
Visual Studio SDK 2019, 2022