IOutputChannelTransport Interface#
How a host carries a channel's traffic to the view rendering it. Implemented once per shell, because there is no mechanism the in-process and out-of-process hosts share: one calls into the page and the other writes a notification down a pipe.
public interface IOutputChannelTransport
Remarks#
Both methods are given a channel id rather than a view handle. Resolving the id to something that can be written to belongs to the shell, which is the only part that knows what a view is.
Methods#
CloseAsync(string, string, CancellationToken) Method#
Tells the channel's view that the channel is gone and it should stop expecting answers. Called once per channel, and not at session teardown, where the view goes away too.
System.Threading.Tasks.Task CloseAsync(string channelId, string reason, System.Threading.CancellationToken ct);
Parameters#
channelId System.String
reason System.String
ct System.Threading.CancellationToken
Returns#
PostAsync(string, string, object, CancellationToken) Method#
Delivers one message to the channel's view. messageType already carries
its ext/ prefix, which marks it as an owner's message rather than one of the
framework's own. A shell whose own envelope already says that much may drop the prefix on
the last hop, as long as what the view sees is the type the owner posted.
System.Threading.Tasks.Task PostAsync(string channelId, string messageType, object? payload, System.Threading.CancellationToken ct);
Parameters#
channelId System.String
messageType System.String
payload System.Object
ct System.Threading.CancellationToken