26.247. Class WorkerStreamHandler

Namespace: ArmoniK.Core.Common.Stream.Worker
Assembly: ArmoniK.Core.Common.dll

Handles the interactions with the worker.

public class WorkerStreamHandler : IWorkerStreamHandler, IInitializable, IHealthCheckProvider, IDisposable

26.247.1. Inheritance

objectWorkerStreamHandler

26.247.2. Implements

IWorkerStreamHandler, IInitializable, IHealthCheckProvider, IDisposable

26.247.3. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

26.247.4. Constructors

26.247.4.1. WorkerStreamHandler(GrpcChannelProvider, InitWorker, ILogger<WorkerStreamHandler>)

Initializes a new instance of the class.

public WorkerStreamHandler(GrpcChannelProvider channelProvider, InitWorker optionsInitWorker, ILogger<WorkerStreamHandler> logger)

26.247.4.1.1. Parameters

channelProvider GrpcChannelProvider

The gRPC channel provider.

optionsInitWorker InitWorker

The initialization options for the worker.

logger ILogger<WorkerStreamHandler>

The logger instance.

26.247.5. Methods

26.247.5.1. Check(HealthCheckTag)

Checks the status of a class for the given health check type.

public Task<HealthCheckResult> Check(HealthCheckTag tag)

26.247.5.1.1. Parameters

tag HealthCheckTag

Health check for which the class has to answer.

26.247.5.1.2. Returns

Task<HealthCheckResult>

The result of the check containing the status of the class for the health check type.

26.247.5.2. Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

26.247.5.3. Init(CancellationToken)

Executes an initialization process for the class

public Task Init(CancellationToken cancellationToken)

26.247.5.3.1. Parameters

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.247.5.3.2. Returns

Task

Task representing the asynchronous execution of the method

26.247.5.4. StartTaskProcessing(TaskData, string, string, Configuration, CancellationToken)

Sends a task to a worker for processing and waits for its completion.

public Task<Output> StartTaskProcessing(TaskData taskData, string token, string dataFolder, Configuration configuration, CancellationToken cancellationToken)

26.247.5.4.1. Parameters

taskData TaskData

The task data containing all information needed to process the task.

token string

Authentication token for the worker.

dataFolder string

The path to the folder where task data can be stored.

configuration Configuration

The configuration to be sent to the worker

cancellationToken CancellationToken

Token to cancel the task processing.

26.247.5.4.2. Returns

Task<Output>

The output of the task processing, including status and any error information.