Class PipelineObserver

Namespace
REslava.Result
Assembly
REslava.Result.dll

Registers a ResultFlowObserver to receive pipeline execution events from Bind, Map, Ensure, Tap, and Match calls.

public static class PipelineObserver
Inheritance
PipelineObserver
Inherited Members

Properties

Current

Returns the currently registered observer, or null if none is registered.

public static ResultFlowObserver? Current { get; }

Property Value

ResultFlowObserver

Methods

BeginPipeline(string, string, string?, string[]?)

Begins a traced pipeline execution. Fires OnPipelineStart(PipelineStartContext), sets the REslava.Result.Observers.PipelineState for the current async context (saving any outer state for nested pipelines), and returns a scope that fires OnPipelineEnd(PipelineEndContext) on dispose. Call from a _Traced generated wrapper inside a try/finally.

public static PipelineScope BeginPipeline(string pipelineId, string methodName, string? inputValue, string[]? nodeIds)

Parameters

pipelineId string

Stable identifier for this pipeline (e.g. FNV-1a hash).

methodName string

The user's method name (e.g. "PlaceOrder").

inputValue string

Optional string representation of the input for display.

nodeIds string[]

Ordered node identifiers matching the pipeline steps.

Returns

PipelineScope

Register(ResultFlowObserver)

Registers the observer globally. Replaces any previously registered observer. Call in Program.cs before the app starts processing requests.

public static void Register(ResultFlowObserver observer)

Parameters

observer ResultFlowObserver

RegisterScoped(ResultFlowObserver)

Registers the observer for the duration of the returned scope. Restores the previous observer on dispose. Useful in tests.

public static IDisposable RegisterScoped(ResultFlowObserver observer)

Parameters

observer ResultFlowObserver

Returns

IDisposable

Unregister()

Removes the currently registered observer.

public static void Unregister()