IBridgeTransport interface

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public interface IBridgeTransport

The host adapter surface used by generated bridges to bind routes and publish state.

Methods

Bind

IDisposable Bind(string name, Func<IBridgeArguments, string> handler)

Binds a synchronous browser route.

Returns

A lease that unbinds the route.

BindAsync

IDisposable BindAsync(string name, Func<IBridgeArguments, CancellationToken, ValueTask<string>> handler)

Binds an asynchronous browser route.

Returns

A lease that unbinds the route.

Publish

void Publish(string name, string stateJson)

Delivers an encoded state snapshot to the browser listener for name.

Remarks

A transport that does not implement IAsyncBridgeTransport must send every call, in call order and without coalescing, because collection delta frames depend on every preceding frame. CS-WebUI does this: each call writes one WebSocket message to every connected client and returns once the socket write completes.