Skip to main content

IAdapterHub

Namespace: Meshmakers.Octo.Communication.Contracts.Hubs

Interface of the adapter hub that is responsible for registering and unregistering adapters and managing their state.

public interface IAdapterHub

Methods​

RegisterAdapterAsync(RtEntityId)​

Registers an adapter at the communication controller

Task<AdapterConfigurationDto> RegisterAdapterAsync(RtEntityId adapterRtEntityId)

Parameters​

adapterRtEntityId RtEntityId
Object identifier of the adapter

Returns​

Task<AdapterConfigurationDto>

RegisterAdapterWithNodesAsync(RtEntityId, IReadOnlyList<NodeDescriptorDto>)​

Registers an adapter at the communication controller with node descriptors

Task<AdapterConfigurationDto> RegisterAdapterWithNodesAsync(RtEntityId adapterRtEntityId, IReadOnlyList<NodeDescriptorDto> nodeDescriptors)

Parameters​

adapterRtEntityId RtEntityId
Object identifier of the adapter

nodeDescriptors IReadOnlyList<NodeDescriptorDto>
Descriptors of pipeline nodes provided by this adapter

Returns​

Task<AdapterConfigurationDto>

RegisterAdapterWithSchemaAsync(RtEntityId, IReadOnlyList<NodeDescriptorDto>, String)​

Registers an adapter at the communication controller with node descriptors and a pipeline schema

Task<AdapterConfigurationDto> RegisterAdapterWithSchemaAsync(RtEntityId adapterRtEntityId, IReadOnlyList<NodeDescriptorDto> nodeDescriptors, string pipelineSchemaJson)

Parameters​

adapterRtEntityId RtEntityId
Object identifier of the adapter

nodeDescriptors IReadOnlyList<NodeDescriptorDto>
Descriptors of pipeline nodes provided by this adapter

pipelineSchemaJson String
Composite JSON Schema for the full pipeline definition

Returns​

Task<AdapterConfigurationDto>

UnRegisterAdapterAsync(RtEntityId)​

Unregisters an adapter from the communication controller

Task UnRegisterAdapterAsync(RtEntityId adapterRtEntityId)

Parameters​

adapterRtEntityId RtEntityId
Object identifier of the adapter

Returns​

Task

SendDebugDataAsync(RtEntityId, Guid, DebugPointDto)​

Sends debug data to the communication controller

Task SendDebugDataAsync(RtEntityId pipelineRtEntityId, Guid pipelineExecutionId, DebugPointDto debugPoint)

Parameters​

pipelineRtEntityId RtEntityId
Object identifier of the pipeline

pipelineExecutionId Guid
Guid that identifies the pipeline execution instance

debugPoint DebugPointDto
Debug information of a node execution

Returns​

Task

SendDeploymentUpdateResultAsync(RtEntityId, DeploymentResult)​

Updates the server about the result of an adapter configuration update.

Task SendDeploymentUpdateResultAsync(RtEntityId adapterRtEntityId, DeploymentResult deploymentResult)

Parameters​

adapterRtEntityId RtEntityId
Object identifier of the adapter

deploymentResult DeploymentResult
The result of the deployment

Returns​

Task

ReportExecutionStartAsync(PipelineExecutionStartDto)​

Reports the start of a pipeline execution to the communication controller.

Task ReportExecutionStartAsync(PipelineExecutionStartDto startDto)

Parameters​

startDto PipelineExecutionStartDto
Details about the execution start

Returns​

Task

ReportPipelineStatusAsync(PipelineStatusReportDto)​

Reports a pipeline's live status line to the communication controller, which writes it to the pipeline entity's StatusMessage. Sent by a trigger node after every poll and from its failure path; informational and fire-and-forget on the wire, like IAdapterHub.ReportExecutionStartAsync(PipelineExecutionStartDto). The pipeline must belong to the calling adapter.

Task ReportPipelineStatusAsync(PipelineStatusReportDto status)

Parameters​

status PipelineStatusReportDto
The status line, its timestamp and whether it reports a failure

Returns​

Task

ReportExecutionEndAsync(PipelineExecutionEndDto)​

Reports the end of a pipeline execution to the communication controller.

Task ReportExecutionEndAsync(PipelineExecutionEndDto endDto)

Parameters​

endDto PipelineExecutionEndDto
Details about the execution end including status and duration

Returns​

Task

ReportInterruptedExecutionResultAsync(PipelineExecutionEndDto)​

Reports the final result of an execution that was previously marked as interrupted. Called after adapter reconnects to update the final status of interrupted executions.

Task ReportInterruptedExecutionResultAsync(PipelineExecutionEndDto endDto)

Parameters​

endDto PipelineExecutionEndDto
Details about the execution end

Returns​

Task

GetInterruptedExecutionIdsAsync()​

Gets the list of execution IDs that were marked as interrupted when this adapter disconnected. Called after reconnection to determine which executions need their final status reported.

Task<IReadOnlyList<string>> GetInterruptedExecutionIdsAsync()

Returns​

Task<IReadOnlyList<String>>
List of execution IDs that are in interrupted state

FailOrphanedExecutionsAsync(DateTime)​

Fails all non-terminal executions of this adapter that started before the given process start time. Called once by a freshly (re)started adapter process: because a new process cannot own any earlier execution, those records are orphans left behind by the previous process (whose in-memory task was lost on restart) and are transitioned to Failed.

Task<int> FailOrphanedExecutionsAsync(DateTime processStartUtc)

Parameters​

processStartUtc DateTime
The adapter process start time (UTC)

Returns​

Task<Int32>
Number of orphaned executions that were failed

ReportAdapterMetricsAsync(AdapterMetricsSampleDto)​

Reports a resource-utilisation sample (CPU, memory, threads) of the adapter process. Pushed periodically by the SDK metrics sampler; the controller keeps a short in-memory history per adapter to back the UI sparklines.

Task ReportAdapterMetricsAsync(AdapterMetricsSampleDto sample)

Parameters​

sample AdapterMetricsSampleDto
The metrics sample

Returns​

Task