Class Processor
Main class delegating parallel G/M/T-code execution
Inherited Members
Namespace: DuetControlServer.Codes
Assembly: DuetControlServer.dll
Syntax
public static class Processor
Methods
CancelCode(Code, Exception?)
Cancel a given code
Declaration
public static void CancelCode(Code code, Exception? e = null)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code to cancel |
Exception | e | Optional exception causing the cancellation |
CodeCompleted(Code)
Execute a given code on a given pipeline stage
Declaration
public static void CodeCompleted(Code code)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code to enqueue |
Diagnostics(StringBuilder)
Get diagnostics from every channel processor
Declaration
public static void Diagnostics(StringBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
StringBuilder | builder | String builder to write to |
FlushAsync(CodeChannel, bool)
Wait for all pending codes to finish
Declaration
public static Task<bool> FlushAsync(CodeChannel channel, bool flushAll = false)
Parameters
Type | Name | Description |
---|---|---|
CodeChannel | channel | Code channel to wait for |
bool | flushAll |
Returns
Type | Description |
---|---|
Task<bool> | Whether the codes have been flushed successfully |
FlushAsync(Code, bool, bool, bool, bool)
Wait for all pending codes on the same stack level as the given code to finish. By default this replaces all expressions as well for convenient parsing by the code processors.
Declaration
public static Task<bool> FlushAsync(Code code, bool evaluateExpressions = true, bool evaluateAll = true, bool syncFileStreams = false, bool ifExecuting = true)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code waiting for the flush |
bool | evaluateExpressions | Evaluate all expressions when pending codes have been flushed |
bool | evaluateAll | Evaluate the expressions or only SBC fields if evaluateExpressions is set to true |
bool | syncFileStreams | Whether the file streams are supposed to be synchronized (if applicable) |
bool | ifExecuting | Return true only if the corresponding code input is actually active (ignored if syncFileStreams is true) |
Returns
Type | Description |
---|---|
Task<bool> | Whether the codes have been flushed successfully |
FlushAsync(CodeFile)
Wait for all pending codes of the given file to finish
Declaration
public static Task<bool> FlushAsync(CodeFile file)
Parameters
Type | Name | Description |
---|---|---|
CodeFile | file | Code file |
Returns
Type | Description |
---|---|
Task<bool> | Whether the codes have been flushed successfully |
Init()
Initialize this class
Declaration
public static void Init()
Run()
Task representing the lifecycle of this class
Declaration
public static Task Run()
Returns
Type | Description |
---|---|
Task |
StartCodeAsync(Code)
Start the execution of a given code
Declaration
public static ValueTask StartCodeAsync(Code code)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code to enqueue |
Returns
Type | Description |
---|---|
ValueTask | Asynchronous task |