Class BowireSseProtocol
- Namespace
- Kuestenlogik.Bowire.Protocol.Sse
- Assembly
- Kuestenlogik.Bowire.Protocol.Sse.dll
Bowire protocol plugin for Server-Sent Events (SSE).
Discovers SSE endpoints via SseEndpointAttribute, Produces("text/event-stream")
metadata, or manual registration. Auto-discovered by BowireProtocolRegistry.
Also implements IInlineSseSubscriber so other plugins (MCP
notifications, GraphQL graphql-sse subscriptions) can reuse the SSE
event-stream parser via FindSseSubscriber()
without taking a compile-time dependency on this assembly.
public sealed class BowireSseProtocol : IBowireProtocol, IInlineSseSubscriber
- Inheritance
-
BowireSseProtocol
- Implements
- Inherited Members
Constructors
BowireSseProtocol()
public BowireSseProtocol()
Properties
IconSvg
SVG icon for the protocol tab.
public string IconSvg { get; }
Property Value
Id
Short identifier (e.g., "grpc", "signalr").
public string Id { get; }
Property Value
Name
Protocol name shown in UI tabs.
public string Name { get; }
Property Value
Methods
DiscoverAsync(string, bool, CancellationToken)
Discover available services and methods.
public Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolctCancellationToken
Returns
Initialize(IServiceProvider?)
Called after registration to inject the app's service provider (embedded mode).
public void Initialize(IServiceProvider? serviceProvider)
Parameters
serviceProviderIServiceProvider
InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a unary or client-streaming call.
public Task<InvokeResult> InvokeAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a server-streaming or duplex call.
public IAsyncEnumerable<string> InvokeStreamAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)
Open an interactive channel (for duplex/client-streaming).
public Task<IBowireChannel?> OpenChannelAsync(string serverUrl, string service, string method, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringshowInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
RegisterEndpoint(SseEndpointInfo)
Register an SSE endpoint for Bowire discovery.
Call before MapBowire() or during startup.
public static void RegisterEndpoint(SseEndpointInfo endpoint)
Parameters
endpointSseEndpointInfo
SubscribeAsync(string, Dictionary<string, string>?, CancellationToken)
Open an SSE connection to url with the given
request headers and yield each parsed event as a JSON envelope of the
form { id, event, data, retry }. The stream stays open until
the server closes it or ct is cancelled.
public IAsyncEnumerable<string> SubscribeAsync(string url, Dictionary<string, string>? headers, CancellationToken ct = default)
Parameters
urlstringheadersDictionary<string, string>ctCancellationToken