Zum Hauptinhalt springen

AdapterPoolHubClient

Namespace: Meshmakers.Octo.Sdk.ServiceClient.CommunicationControllerServices

Client proxy for the adapter pool management hub of the communication controller (AB#4924, concept §4).

public class AdapterPoolHubClient : SignalRClient<AdapterPoolHubClientOptions>, ISignalRClient<AdapterPoolHubClientOptions>, IAdapterPoolHubClient, IAdapterPoolHub

Inheritance Object → SignalRClient<AdapterPoolHubClientOptions> → AdapterPoolHubClient
Implements ISignalRClient<AdapterPoolHubClientOptions>, IAdapterPoolHubClient, IAdapterPoolHub

Remarks:

Mirrors OperatorHubClient rather than AdapterHubClient, because the thing it has in common with the operator channel is the one that shapes it: the connection is not tenant-addressed. See for why a pool member cannot use /{tenantId}/adapterHub.

Fields​

HubName​

The hub path. A constant rather than a literal in two places, because the controller's route and this override have to agree and nothing else would notice if they drifted.

public static string HubName;

Properties​

IsAlive​

public bool IsAlive { get; }

Property Value​

Boolean

ClientAccessToken​

public IServiceClientAccessToken ClientAccessToken { get; }

Property Value​

IServiceClientAccessToken

Options​

public AdapterPoolHubClientOptions Options { get; }

Property Value​

AdapterPoolHubClientOptions

ServiceUri​

public Uri ServiceUri { get; }

Property Value​

Uri

Constructors​

AdapterPoolHubClient(IOptions<AdapterPoolHubClientOptions>, ILogger<AdapterPoolHubClient>, IServiceClientAccessToken, IAdapterPoolHubCallbacks)​

Constructor.

public AdapterPoolHubClient(IOptions<AdapterPoolHubClientOptions> options, ILogger<AdapterPoolHubClient> logger, IServiceClientAccessToken serviceClientAccessToken, IAdapterPoolHubCallbacks callbacks)

Parameters​

options IOptions<AdapterPoolHubClientOptions>
Options for configuration of the client proxy.

logger ILogger<AdapterPoolHubClient>
Logger instance.

serviceClientAccessToken IServiceClientAccessToken
The access token management object.

callbacks IAdapterPoolHubCallbacks
Handlers for the lease and drain pushes.

AdapterPoolHubClient(AdapterPoolHubClientOptions, ILogger<AdapterPoolHubClient>, IServiceClientAccessToken, IAdapterPoolHubCallbacks)​

Constructor.

public AdapterPoolHubClient(AdapterPoolHubClientOptions options, ILogger<AdapterPoolHubClient> logger, IServiceClientAccessToken serviceClientAccessToken, IAdapterPoolHubCallbacks callbacks)

Parameters​

options AdapterPoolHubClientOptions
Options for configuration of the client proxy.

logger ILogger<AdapterPoolHubClient>
Logger instance.

serviceClientAccessToken IServiceClientAccessToken
The access token management object.

callbacks IAdapterPoolHubCallbacks
Handlers for the lease and drain pushes.

Methods​

RegisterServerCallbacks(HubConnection)​

Binds the server-to-client callbacks on every (re-)created connection — the same rule as the other two hub clients. Binding once in the constructor loses every push after a stop/start cycle, and on this channel a lost push is a lease that is granted server-side and never acted on.

protected void RegisterServerCallbacks(HubConnection hubConnection)

Parameters​

hubConnection HubConnection

BuildServiceUri()​

Builds the tenant-free hub URI. A pool member's management connection addresses no tenant, which is exactly why it cannot use the base implementation — that one throws when the options carry no tenant, and it is right to, for every tenant-addressed hub.

protected Uri BuildServiceUri()

Returns​

Uri

RegisterPoolMemberAsync(PoolMemberRegistrationDto)​

public Task<PoolMemberRegistrationResultDto> RegisterPoolMemberAsync(PoolMemberRegistrationDto registration)

Parameters​

registration PoolMemberRegistrationDto

Returns​

Task<PoolMemberRegistrationResultDto>

ResumePoolMemberAsync(PoolMemberRegistrationDto)​

public Task<PoolMemberRegistrationResultDto> ResumePoolMemberAsync(PoolMemberRegistrationDto registration)

Parameters​

registration PoolMemberRegistrationDto

Returns​

Task<PoolMemberRegistrationResultDto>

Remarks:

A controller that pre-dates AB#5826 answers with a HubException (unknown hub method); the caller treats that as "not supported" and falls back to deferring its registration.

ReleaseLeaseAsync(LeaseResultDto)​

public Task ReleaseLeaseAsync(LeaseResultDto result)

Parameters​

result LeaseResultDto

Returns​

Task

HeartbeatAsync(PoolMemberHeartbeatDto)​

public Task HeartbeatAsync(PoolMemberHeartbeatDto heartbeat)

Parameters​

heartbeat PoolMemberHeartbeatDto

Returns​

Task