Class PipelineBase
Abstract base class for pipeline elements
Inherited Members
Namespace: DuetControlServer.Codes.Pipelines
Assembly: DuetControlServer.dll
Syntax
public abstract class PipelineBase
Constructors
PipelineBase(PipelineStage, ChannelProcessor)
Constructor of this class
Declaration
public PipelineBase(PipelineStage stage, ChannelProcessor processor)
Parameters
Type | Name | Description |
---|---|---|
PipelineStage | stage | Stage type |
ChannelProcessor | processor | Channel processor |
Fields
Processor
Corresponding channel processor
Declaration
public readonly ChannelProcessor Processor
Field Value
Type | Description |
---|---|
ChannelProcessor |
Stage
Stage of this instance
Declaration
public readonly PipelineStage Stage
Field Value
Type | Description |
---|---|
PipelineStage |
_baseItem
Base state of this pipeline
Declaration
protected readonly PipelineStackItem _baseItem
Field Value
Type | Description |
---|---|
PipelineStackItem |
_stack
Stacks holding state information per input channel
Declaration
protected readonly Stack<PipelineStackItem> _stack
Field Value
Type | Description |
---|---|
Stack<PipelineStackItem> |
Methods
Diagnostics(StringBuilder)
Get the diagnostics from this pipeline stage
Declaration
public void Diagnostics(StringBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
StringBuilder | builder | String builder to write to |
Exceptions
Type | Condition |
---|---|
NotImplementedException |
FlushAsync(Code, bool, bool)
Wait for the pipeline stage to become idle
Declaration
public virtual Task<bool> FlushAsync(Code code, bool evaluateExpressions = true, bool evaluateAll = 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 |
Returns
Type | Description |
---|---|
Task<bool> | Whether the codes have been flushed successfully |
FlushAsync(CodeFile)
Wait for the pipeline stage to become idle
Declaration
public virtual 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 |
FlushAsync(bool)
Wait for the first or current pipeline stack item to become idle
Declaration
public virtual Task<bool> FlushAsync(bool flushAll)
Parameters
Type | Name | Description |
---|---|---|
bool | flushAll | Flush everything |
Returns
Type | Description |
---|---|
Task<bool> |
IsIdle(Code?)
Check if this stage is currently idle
Declaration
public bool IsIdle(Code? code)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Optional code requesting the check |
Returns
Type | Description |
---|---|
bool | Whether this pipeline stage is idle |
ProcessCodeAsync(Code)
Process a code from a given code channel
Declaration
public abstract Task ProcessCodeAsync(Code code)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code to process |
Returns
Type | Description |
---|---|
Task | Asynchronous task |
WriteCode(Code)
Enqueue a given code on this pipeline state for execution. This should not be used unless the corresponding code channel is unbounded
Declaration
public virtual void WriteCode(Code code)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code to enqueue |
WriteCodeAsync(Code)
Enqueue a given code asynchronously on this pipeline state for execution
Declaration
public virtual ValueTask WriteCodeAsync(Code code)
Parameters
Type | Name | Description |
---|---|---|
Code | code | Code to enqueue |
Returns
Type | Description |
---|---|
ValueTask | Asynchronous task |