Class PipelineStackItem
- Namespace
- DuetControlServer.Codes.Pipelines
- Assembly
- DuetControlServer.dll
Class representing an execution level on a given pipeline. This is the effective target for incoming codes
public sealed class PipelineStackItem
- Inheritance
-
PipelineStackItem
- Inherited Members
Constructors
PipelineStackItem(PipelineBase, CodeFile?, CodeProcessor, Settings, IHostApplicationLifetime)
Constructor of this class
public PipelineStackItem(PipelineBase pipeline, CodeFile? file, CodeProcessor codeProcessor, Settings settings, IHostApplicationLifetime lifetime)
Parameters
pipelinePipelineBasePipeline holding this stack item
fileCodeFileCurrent file or null if not present
codeProcessorCodeProcessorCode processor
settingsSettingsSettings to use
lifetimeIHostApplicationLifetimeHost application lifetime
Fields
CodeBeingExecuted
Current code being executed. This is not applicable on the Firmware stage because we buffer multiple codes there
public Code? CodeBeingExecuted
Field Value
File
Code file corresponding to this stack item
public CodeFile? File
Field Value
PendingCodes
Pending codes to be executed
public readonly Channel<Code> PendingCodes
Field Value
ProcessorTask
Internal task processing incoming codes
public readonly Task ProcessorTask
Field Value
Properties
Busy
Indicates if the pipeline state is busy processing codes
public bool Busy { get; set; }
Property Value
Methods
FlushAsync(CancellationToken)
Wait for the pipeline state to finish processing codes
public Task<bool> FlushAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenOptional cancellation token
Returns
Remarks
This method does not throw an exception even if the cancellation token is triggered
WriteCode(Code)
Enqueue a given code on this pipeline state for execution
public void WriteCode(Code code)
Parameters
codeCodeCode to enqueue
WriteCodeAsync(Code, CancellationToken)
Enqueue a given code asynchrously on this pipeline state for execution
public ValueTask WriteCodeAsync(Code code, CancellationToken cancellationToken = default)
Parameters
codeCodeCode to enqueue
cancellationTokenCancellationTokenOptional cancellation token
Returns
- ValueTask
Asynchronous task