public interface IForwardedLaunchReply : IAsyncDisposable The launching process's side of a reply to a forwarded launch: the running instance's messages, in order, then its exit status. Disposing it before the exit status arrives cancels the launch in the running instance.
Remarks
Read from one caller at a time. IForwardedLaunchReply.CancelAsync can be called at any time, from any thread.
Methods
CancelAsync
ValueTask CancelAsync() Asks the running instance to cancel the launch, cancelling IApplicationLaunchReply.CancelRequested (and with it IApplicationLaunchReply.Cancelled), and keeps the connection: the running instance's last messages and exit status still arrive. Later calls do nothing.
ReadMessagesAsync
IAsyncEnumerable<string> ReadMessagesAsync(CancellationToken cancellationToken = default) The messages not read yet. The sequence ends at the exit status, or when the running instance ended without one; IForwardedLaunchReply.WaitForExitAsync then tells which.
Parameters
cancellationTokenStops reading and closes the connection, which cancels the launch in the running instance.
WaitForExitAsync
ValueTask<PlatformResult<int>> WaitForExitAsync(CancellationToken cancellationToken = default) Waits for the exit status, discarding messages not read yet.
Parameters
cancellationTokenStops waiting and closes the connection, which cancels the launch in the running instance.
Returns
The exit status; PlatformFailureCode.IOError when the running instance ended or the connection broke before it answered, and PlatformFailureCode.InvalidData for a malformed reply.