private async Task ProcessAsync() { try { await IncomingChannels.Completion.ConfigureAwait(false); _connection.TryComplete(); } catch (Exception ex) { _connection.TryTerminate(ex); throw; } finally { await _connection.Completion.ConfigureAwait(false); } }
public static async Task CompleteAsync(this ITransportConnection connection) { connection.TryComplete(); do { while (connection.IncomingChannels.TryRead(out _)) { } } while (await connection.IncomingChannels.WaitReadAvailableAsync().ConfigureAwait(false)); await connection.Completion.ConfigureAwait(false); }
public static async Task CompleteAsync(this ITransportConnection connection) { connection.TryComplete(); while (await connection.IncomingChannels.WaitForNextSafeAsync().ConfigureAwait(false)) { while (connection.IncomingChannels.TryReadSafe(out _)) { } } await connection.Completion.ConfigureAwait(false); }
public bool TryComplete() { return(_transportConnection.TryComplete()); }