Interface IProtoTargetProvider

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

A run piece that can serve a target - an application's address, a store, a broker or a worker. A target registers its providers in priority order; the first provider whose condition holds serves it, so only that provider's piece starts and only that provider's capabilities are declared.

public interface IProtoTargetProvider
Extension Methods

Remarks

A provider is the extension point behind AddInfrastructure(name, chain, keys): a third party writes one by implementing this interface or by constructing ProtoTargetProvider, and the framework resolves it without knowing the environment it describes. Conditions are evaluated against the resolved configuration while the host is built, before any piece starts.

Properties

Capabilities

Gets the capabilities the provider serves. Only the winning provider's capabilities are declared, so a losing provider never advertises something the run cannot do.

IReadOnlyList<ProtoCapabilityDescriptor> Capabilities { get; }

Property Value

IReadOnlyList<ProtoCapabilityDescriptor>

Condition

Gets the condition under which this provider can serve the target; null means the provider is always available.

IProtoProviderCondition? Condition { get; }

Property Value

IProtoProviderCondition

Infrastructure

Gets the piece that serves the target when this provider wins - started with the run and released with it, filling the target's declared keys. null when configuration itself serves the target, so the provider starts nothing.

IProtoInfrastructure? Infrastructure { get; }

Property Value

IProtoInfrastructure

Name

Gets the name that identifies the provider in the resolution record and skip reasons.

string Name { get; }

Property Value

string

Methods

ConfigureServices(IServiceCollection)

Contributes the services that exist only while this provider serves its target - the client initializers, transports and per-target registrations another provider's process cannot supply. Called while the host is built, for the winning provider only, so a losing provider leaves no service behind.

void ConfigureServices(IServiceCollection services)

Parameters

services IServiceCollection