Table of Contents

Interface ICodeHandler

Namespace
DuetControlServer.Codes.Handlers
Assembly
DuetControlServer.dll

Interface for code handlers that process codes sent to the control server

public interface ICodeHandler

Methods

CodeExecutedAsync(Code, CancellationToken)

React to an executed code before its result is returned

ValueTask CodeExecutedAsync(Code code, CancellationToken cancellationToken)

Parameters

code Code

Code processed by RepRapFirmware

cancellationToken CancellationToken

Cancellation token

Returns

ValueTask

Result to output

ProcessAsync(Code, CancellationToken)

Process a code that should be interpreted by the control server

ValueTask<Message?> ProcessAsync(Code code, CancellationToken cancellationToken)

Parameters

code Code

Code to process

cancellationToken CancellationToken

Cancellation token

Returns

ValueTask<Message>

Result of the code if the code completed, else null