Table of Contents

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

container IBrokeredServiceContainer

The container.

descriptor IJsonRpcDescriptor<T>

The server descriptor.

factory Func<CancellationToken, ValueTask<T>>

The per-client factory.

Returns

IDisposable

The proffer lease.

Type Parameters

T

The 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

container IBrokeredServiceContainer

The container.

descriptor IJsonRpcDescriptor<T>

The server descriptor.

factory Func<ValueTask<T>>

The per-client factory.

Returns

IDisposable

The proffer lease.

Type Parameters

T

The 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

container IBrokeredServiceContainer

The container.

descriptor IJsonRpcDescriptor<T>

The server descriptor.

factory Func<T>

The per-client factory.

Returns

IDisposable

The proffer lease.

Type Parameters

T

The primary service contract.