示例#1
0
        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);
            }
        }
示例#2
0
 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);
 }
示例#4
0
 public bool TryComplete()
 {
     return(_transportConnection.TryComplete());
 }