DesktopBridgeTransport class

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

public sealed class DesktopBridgeTransport : IAsyncBridgeTransport, IBridgeTransport, IDisposable

Inherits or implements IAsyncBridgeTransport, IBridgeTransport, IDisposable.

Adapts a Desktop surface's removable capabilities to the Views transport.

Remarks

Disposing the transport removes every capability it registered and stops state delivery, while the surface itself stays open. A window uses this to close its browser routes before accepted operations have drained.

Constructors

DesktopBridgeTransport

public DesktopBridgeTransport(DesktopSurface surface)

Creates a transport for surface.

Methods

Bind

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

Binds a synchronous browser route.

Returns

A lease that unbinds the route.

Documentation from IBridgeTransport.Bind.

BindAsync

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

Binds an asynchronous browser route.

Returns

A lease that unbinds the route.

Documentation from IBridgeTransport.BindAsync.

Dispose

public void Dispose()

Removes every registered capability and stops state delivery; the surface stays open.

Publish

public void Publish(string name, string stateJson)

Queues a state publication without blocking the caller. A route has at most one script in flight; a newer state replaces one that has not been sent yet.

PublishAsync

public ValueTask PublishAsync(string name, string stateJson)

Delivers one frame without coalescing it with other frames.

Remarks

Generated bridges await this outside the model context. Slow delivery is bounded by the bridge's recovery-snapshot queue.

Documentation from IAsyncBridgeTransport.PublishAsync.