Class RingBufferObserver

Namespace
REslava.Result.Observers
Assembly
REslava.Result.dll

A ResultFlowObserver that stores the last Capacity pipeline executions in an in-memory ring buffer. Thread-safe. Zero persistence — cleared on restart.

public sealed class RingBufferObserver : ResultFlowObserver
Inheritance
RingBufferObserver
Inherited Members
Extension Methods

Constructors

RingBufferObserver(int)

public RingBufferObserver(int capacity = 50)

Parameters

capacity int

Properties

Capacity

public int Capacity { get; }

Property Value

int

Methods

Clear()

Clears all captured traces.

public void Clear()

GetTraces()

Returns a snapshot of captured traces, oldest first.

public IReadOnlyList<PipelineTrace> GetTraces()

Returns

IReadOnlyList<PipelineTrace>

OnNodeExit(NodeExitContext)

Called immediately after a node completes, with the outgoing result.

public override void OnNodeExit(NodeExitContext ctx)

Parameters

ctx NodeExitContext

OnPipelineEnd(PipelineEndContext)

Called once after the pipeline completes (success or failure).

public override void OnPipelineEnd(PipelineEndContext ctx)

Parameters

ctx PipelineEndContext

OnPipelineStart(PipelineStartContext)

Called once before the first node executes.

public override void OnPipelineStart(PipelineStartContext ctx)

Parameters

ctx PipelineStartContext

Save(string?)

Serializes all captured traces to a JSON file so the REslava VSIX Debug panel can load them without a running HTTP server. Default path: reslava-traces.json next to the executing assembly (BaseDirectory). Overwrites any existing file.

public void Save(string? path = null)

Parameters

path string

Optional absolute or relative path. When null, writes to {AppContext.BaseDirectory}/reslava-traces.json.