public sealed class BridgeInteractionRouter : IDisposable Window-owned request/reply broker for typed interaction adapters. A presentation that a page opened over Views protocol 4 registers its handlers with open or interactions, receives interaction and interaction-cancelled pushes on its connection, and answers with interaction-reply. With view-requests/1 it also registers view request handlers with view-requests and receives view-request pushes, which it does not answer.
Methods
Dispose
public void Dispose() Cancels pending interactions and forgets the window's presentations.
Register
public IDisposable Register<TInput, TOutput>(string route, string name, string contract, Func<TInput, string> encodeInput, Func<JsonElement, TOutput> decodeOutput, int priority = 0, TimeSpan? timeout = null) Registers a typed interaction surface for one generated bridge route. The route lease is normally owned by the generated bridge attachment.
Exceptions
ArgumentOutOfRangeExceptiontimeoutis not positive or exceeds 24 hours, and is notTimeout.InfiniteTimeSpan.
Remarks
timeout is checked as BridgeInteractionRouter.TryRequest checks it; each request still names its own.
TryRequest
public Task<TOutput>? TryRequest<TInput, TOutput>(string route, string name, string contract, TInput input, Func<TInput, string> encodeInput, Func<JsonElement, TOutput> decodeOutput, TimeSpan? timeout = null) Attempts browser delivery for the current trusted bridge invocation. A null result preserves ReactiveUI fallback/unhandled behavior.
Exceptions
ArgumentOutOfRangeExceptiontimeoutis not positive or exceeds 24 hours, and is notTimeout.InfiniteTimeSpan.
Remarks
The invocation must belong to this window. A bridged command reaches the presentation of route mounted by the client and connection that invoked it: its own route, or another route of the window, such as a content View whose interaction a shell's command asks, or the departure guard of the page that the shell's Back leaves. The window scope (a close decision, a menu-bar command, RunicInteractionInvocation.EnterWindow) reaches the one presentation of the window that handles the interaction.
timeout is how long the page may take to answer: by default two minutes, at most 24 hours, or Timeout.InfiniteTimeSpan for no deadline. When it passes, the request fails with RunicInteractionTimeoutException. Without a deadline the request ends only as every request also does: when the invocation's command or navigation is cancelled, its presentation closes, its connection closes or the window closes, each with RunicInteractionCancelledException.