Class CapturedFlowStore
- Namespace
- Kuestenlogik.Bowire.Proxy
- Assembly
- Kuestenlogik.Bowire.dll
In-memory ring buffer of CapturedFlows plus a fan-out
channel for live subscribers (Workbench Proxy tab over SSE). Bounded
so a long-running bowire proxy session does not eat unbounded
memory — once Capacity flows are stored the oldest one
is evicted before the new one is added.
public sealed class CapturedFlowStore
- Inheritance
-
CapturedFlowStore
- Inherited Members
Constructors
CapturedFlowStore(int)
public CapturedFlowStore(int capacity = 1000)
Parameters
capacityint
Properties
Capacity
Maximum number of flows retained. Older flows are evicted FIFO.
public int Capacity { get; }
Property Value
Methods
Add(CapturedFlow)
Record a finished flow + fan it out to live subscribers.
public void Add(CapturedFlow flow)
Parameters
flowCapturedFlow
Clear()
Drop everything (used by the workbench "Clear" button + tests).
public void Clear()
Get(long)
Lookup a flow by id (newest-first scan; small N).
public CapturedFlow? Get(long id)
Parameters
idlong
Returns
NextId()
Allocate the next monotonic flow id. Call this before recording the request, so the workbench can correlate the half-captured "request seen" event with the eventual "response landed" event.
public long NextId()
Returns
Snapshot()
Newest-first snapshot of currently retained flows.
public IReadOnlyList<CapturedFlow> Snapshot()
Returns
Subscribe(CancellationToken)
Subscribe to live flow events. Returns a channel reader that yields newly-captured flows until cancellation. Slow consumers silently drop the oldest queued event instead of back-pressuring the proxy hot path.
public ChannelReader<CapturedFlow> Subscribe(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationToken