Share via


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.

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;
static member GetProxyAsync : Microsoft.ServiceHub.Framework.IServiceBroker * Microsoft.ServiceHub.Framework.ServiceJsonRpcDescriptor<'T (requires 'T : null)> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'T (requires 'T : null)> (requires 'T : null)
<Extension()>
Public Function GetProxyAsync(Of T As Class) (serviceBroker As IServiceBroker, serviceDescriptor As ServiceJsonRpcDescriptor(Of T), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of T)

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

GetProxyAsync<T>(IServiceBroker, ServiceRpcDescriptor, CancellationToken)

Requests access to some service through a client proxy.

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;
static member GetProxyAsync : Microsoft.ServiceHub.Framework.IServiceBroker * Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'T (requires 'T : null)> (requires 'T : null)
<Extension()>
Public Function GetProxyAsync(Of T As Class) (serviceBroker As IServiceBroker, serviceDescriptor As ServiceRpcDescriptor, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of T)

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