Class BrokeredServiceContainerExtensions
- Namespace
- Nerdbank.JsonRpc.BrokeredServices
- Assembly
- Nerdbank.JsonRpc.dll
Simplifies proffering strongly typed factories that do not need the full activation context.
public static class BrokeredServiceContainerExtensions
- Inheritance
-
BrokeredServiceContainerExtensions
- Inherited Members
Methods
Proffer<T>(IBrokeredServiceContainer, IJsonRpcDescriptor<T>, Func<CancellationToken, ValueTask<T?>>)
Proffers a cancellation-aware asynchronous factory for an already registered service.
public static IDisposable Proffer<T>(this IBrokeredServiceContainer container, IJsonRpcDescriptor<T> descriptor, Func<CancellationToken, ValueTask<T?>> factory) where T : class
Parameters
containerIBrokeredServiceContainerThe container.
descriptorIJsonRpcDescriptor<T>The server descriptor.
factoryFunc<CancellationToken, ValueTask<T>>The per-client factory.
Returns
- IDisposable
The proffer lease.
Type Parameters
TThe primary service contract.
Proffer<T>(IBrokeredServiceContainer, IJsonRpcDescriptor<T>, Func<ValueTask<T?>>)
Proffers a parameterless asynchronous factory for an already registered service.
public static IDisposable Proffer<T>(this IBrokeredServiceContainer container, IJsonRpcDescriptor<T> descriptor, Func<ValueTask<T?>> factory) where T : class
Parameters
containerIBrokeredServiceContainerThe container.
descriptorIJsonRpcDescriptor<T>The server descriptor.
factoryFunc<ValueTask<T>>The per-client factory.
Returns
- IDisposable
The proffer lease.
Type Parameters
TThe primary service contract.
Proffer<T>(IBrokeredServiceContainer, IJsonRpcDescriptor<T>, Func<T?>)
Proffers a synchronous factory for an already registered service.
public static IDisposable Proffer<T>(this IBrokeredServiceContainer container, IJsonRpcDescriptor<T> descriptor, Func<T?> factory) where T : class
Parameters
containerIBrokeredServiceContainerThe container.
descriptorIJsonRpcDescriptor<T>The server descriptor.
factoryFunc<T>The per-client factory.
Returns
- IDisposable
The proffer lease.
Type Parameters
TThe primary service contract.