21.243. 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
21.243.1. Inheritance
21.243.2. Implements
IWorkerStreamHandler, IInitializable, IHealthCheckProvider, IDisposable
21.243.3. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
21.243.4. Constructors
21.243.4.1. WorkerStreamHandler(GrpcChannelProvider, InitWorker, ILogger<WorkerStreamHandler>)
Initializes a new instance of the
public WorkerStreamHandler(GrpcChannelProvider channelProvider, InitWorker optionsInitWorker, ILogger<WorkerStreamHandler> logger)
21.243.4.1.1. Parameters
channelProvider GrpcChannelProvider
The gRPC channel provider.
optionsInitWorker InitWorker
The initialization options for the worker.
logger ILogger<WorkerStreamHandler>
The logger instance.
21.243.5. Methods
21.243.5.1. Check(HealthCheckTag)
Checks the status of a class for the given health check type.
public Task<HealthCheckResult> Check(HealthCheckTag tag)
21.243.5.1.1. Parameters
tag HealthCheckTag
Health check for which the class has to answer.
21.243.5.1.2. Returns
The result of the check containing the status of the class for the health check type.
21.243.5.2. Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
21.243.5.3. Init(CancellationToken)
Executes an initialization process for the class
public Task Init(CancellationToken cancellationToken)
21.243.5.3.1. Parameters
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.243.5.3.2. Returns
Task representing the asynchronous execution of the method
21.243.5.4. StartTaskProcessing(TaskData, string, string, CancellationToken)
Sends a task to a worker for processing and waits for its completion.
public Task<Output> StartTaskProcessing(TaskData taskData, string token, string dataFolder, CancellationToken cancellationToken)
21.243.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.
cancellationToken CancellationToken
Token to cancel the task processing.
21.243.5.4.2. Returns
The output of the task processing, including status and any error information.