ServiceBrokerClient.GetProxyAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetProxyAsync<T>(ServiceRpcDescriptor, CancellationToken) |
Requests access to some service through a client proxy. The same client proxy is returned for a given service and proxy type until it is invalidated. |
GetProxyAsync<T>(ServiceRpcDescriptor, ServiceActivationOptions, CancellationToken) |
Requests access to some service through a client proxy. The same client proxy is returned for a given service and proxy type until it is invalidated. |
GetProxyAsync<T>(ServiceRpcDescriptor, CancellationToken)
Requests access to some service through a client proxy. The same client proxy is returned for a given service and proxy type until it is invalidated.
public:
generic <typename T>
where T : class System::Threading::Tasks::ValueTask<Microsoft::ServiceHub::Framework::ServiceBrokerClient::Rental<T>> GetProxyAsync(Microsoft::ServiceHub::Framework::ServiceRpcDescriptor ^ serviceRpcDescriptor, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.ValueTask<Microsoft.ServiceHub.Framework.ServiceBrokerClient.Rental<T>> GetProxyAsync<T> (Microsoft.ServiceHub.Framework.ServiceRpcDescriptor serviceRpcDescriptor, System.Threading.CancellationToken cancellationToken) where T : class;
member this.GetProxyAsync : Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.ServiceHub.Framework.ServiceBrokerClient.Rental<'T>> (requires 'T : null)
Public Function GetProxyAsync(Of T As Class) (serviceRpcDescriptor As ServiceRpcDescriptor, cancellationToken As CancellationToken) As ValueTask(Of ServiceBrokerClient.Rental(Of T))
Type Parameters
- T
The type of client proxy to create.
Parameters
- serviceRpcDescriptor
- ServiceRpcDescriptor
An descriptor of the service.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A rental around the client proxy that may be used to communicate with the service; or null
if no matching service could be found.
Proxies are kept alive while "rented", and may be kept alive beyond a rental until they are invalidated.
The rental struct should be disposed as soon as the caller is done using it (such that the next use will call GetProxyAsync<T>(ServiceRpcDescriptor, CancellationToken) again and could tolerate getting a client proxy to a different service instance.)
The client proxy itself within the rental struct should NOT be disposed directly since it can be shared across invocations of this method.
Exceptions
Thrown when a service discovery or activation error occurs.
Applies to
GetProxyAsync<T>(ServiceRpcDescriptor, ServiceActivationOptions, CancellationToken)
Requests access to some service through a client proxy. The same client proxy is returned for a given service and proxy type until it is invalidated.
public System.Threading.Tasks.ValueTask<Microsoft.ServiceHub.Framework.ServiceBrokerClient.Rental<T>> GetProxyAsync<T> (Microsoft.ServiceHub.Framework.ServiceRpcDescriptor serviceRpcDescriptor, Microsoft.ServiceHub.Framework.ServiceActivationOptions options = default, System.Threading.CancellationToken cancellationToken = default) where T : class;
member this.GetProxyAsync : Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * Microsoft.ServiceHub.Framework.ServiceActivationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.ServiceHub.Framework.ServiceBrokerClient.Rental<'T>> (requires 'T : null)
Public Function GetProxyAsync(Of T As Class) (serviceRpcDescriptor As ServiceRpcDescriptor, Optional options As ServiceActivationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ServiceBrokerClient.Rental(Of T))
Type Parameters
- T
The type of client proxy to create.
Parameters
- serviceRpcDescriptor
- ServiceRpcDescriptor
An descriptor of the service.
- options
- ServiceActivationOptions
Additional options that alter how the service may be activated or provide additional data to the service constructor. Only used if the service has not already been cached.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A rental around the client proxy that may be used to communicate with the service; or null
if no matching service could be found.
Proxies are kept alive while "rented", and may be kept alive beyond a rental until they are invalidated.
The rental struct should be disposed as soon as the caller is done using it (such that the next use will call GetProxyAsync<T>(ServiceRpcDescriptor, CancellationToken) again and could tolerate getting a client proxy to a different service instance.)
The client proxy itself within the rental struct should NOT be disposed directly since it can be shared across invocations of this method.
Exceptions
Thrown when a service discovery or activation error occurs.