Skip to content

Class SseBehaviorBinding

Namespace: Cephalon.Behaviors.Http.Bindings
Assembly: Cephalon.Behaviors.Http.dll

Server-Sent Events transport binding (transport ID: http.sse). Opens a long-lived SSE stream at canonical routes such as GET /sse/v1/cart/get. Query-string parameters are parsed into a JSON object and deserialized as the behavior’s typed input. The behavior is dispatched immediately; its return value is streamed as a data: {json}\n\n event. The connection stays alive with periodic heartbeat comments until the client disconnects.

public sealed class SseBehaviorBinding : IHttpBehaviorBinding

objectSseBehaviorBinding

IHttpBehaviorBinding

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Canonical routes are derived from the shared plus the configured SSE prefix (canonically ApiRoutes:Prefixes:Sse) and the resolved default behavior document name. GraphQL-over-SSE participates in the same shared API-surface model through its own dedicated prefix rather than reusing the generic SSE endpoint.

Initializes a new .

public SseBehaviorBinding(IConfiguration? configuration = null)

configuration IConfiguration?

Optional configuration used to resolve canonical behavior transport routes. When omitted, the binding falls back to the default /sse/v1 route policy.

Gets the canonical transport identifier, e.g. http.jsonrpc.

public string TransportId { get; }

string

MapAsync(WebApplication, BehaviorTopologyDescriptor, BehaviorDispatcher)

Section titled “ MapAsync(WebApplication, BehaviorTopologyDescriptor, BehaviorDispatcher)”

Maps the behavior’s routes/endpoints onto the . Called at most once per descriptor per transport (lazy-init guards ensure this).

public Task MapAsync(WebApplication app, BehaviorTopologyDescriptor descriptor, BehaviorDispatcher dispatcher)

app WebApplication

The web application to register routes on.

descriptor BehaviorTopologyDescriptor

The behavior topology descriptor.

dispatcher BehaviorDispatcher

The behavior dispatcher to invoke.

Task

A task that completes when all routes are mapped.