Class BowireMockHandleRegistry

Namespace
Kuestenlogik.Bowire.Mcp
Assembly
Kuestenlogik.Bowire.Mcp.dll

In-memory registry of MockServer instances spawned by bowire.mock.start. The MCP host is the owner — handles live for the duration of the host process. bowire.mock.stop looks up and disposes; bowire.mock.list enumerates.

Registered as a singleton in AddBowireMcp(IServiceCollection, Action<BowireMcpOptions>?) so the dictionary is shared across the tool class's lifetime.

public sealed class BowireMockHandleRegistry : IAsyncDisposable
Inheritance
BowireMockHandleRegistry
Implements
Inherited Members

Constructors

BowireMockHandleRegistry()

public BowireMockHandleRegistry()

Methods

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

Register(MockServer)

public string Register(MockServer server)

Parameters

server MockServer

Returns

string

RemoveAndDisposeAsync(string)

public Task<bool> RemoveAndDisposeAsync(string handle)

Parameters

handle string

Returns

Task<bool>

Snapshot()

public IReadOnlyDictionary<string, MockServer> Snapshot()

Returns

IReadOnlyDictionary<string, MockServer>

TryGet(string, out MockServer?)

public bool TryGet(string handle, out MockServer? server)

Parameters

handle string
server MockServer

Returns

bool