Class ServiceBrokerExtensions
- Namespace
- Nerdbank.JsonRpc.BrokeredServices
- Assembly
- Nerdbank.JsonRpc.dll
Provides resilient service acquisition for service brokers.
public static class ServiceBrokerExtensions
- Inheritance
-
ServiceBrokerExtensions
- Inherited Members
Methods
GetResilientProxyAsync<T>(IServiceBroker, IJsonRpcDescriptor<T>, ServiceActivationOptions, ILogger<ServiceProxyContext>?, CancellationToken)
Creates and initializes a stable proxy, including when the service is currently unavailable.
public static ValueTask<ResilientServiceProxy<T>> GetResilientProxyAsync<T>(this IServiceBroker broker, IJsonRpcDescriptor<T> descriptor, ServiceActivationOptions options = default, ILogger<ServiceProxyContext>? logger = null, CancellationToken cancellationToken = default) where T : class
Parameters
brokerIServiceBrokerThe broker to observe.
descriptorIJsonRpcDescriptor<T>The typed contract and its complete allowed additional-interface universe.
optionsServiceActivationOptionsOptions for each activation.
loggerILogger<ServiceProxyContext>The lifecycle logger.
cancellationTokenCancellationTokenCancels initial acquisition.
Returns
- ValueTask<ResilientServiceProxy<T>>
The disposable owner of the stable generated proxy.
Type Parameters
TThe primary service interface.