Example #1
0
        private static async Task Continue(WritableBufferAwaitable awaitable, ReadOperation operation)
        {
            // Keep reading once we get the completion
            if (await awaitable)
            {
                operation.Read();
            }
            else
            {
                operation.Writer.Complete();

                operation.Dispose();
            }
        }
Example #2
0
        private static async Task Continue(ValueAwaiter <FlushResult> awaitable, ReadOperation operation)
        {
            // Keep reading once we get the completion
            var flushResult = await awaitable;

            if (!flushResult.IsCompleted)
            {
                operation.Read();
            }
            else
            {
                operation.Writer.Complete();

                operation.Dispose();
            }
        }
 public void Dispose()
 {
     _readOperation.Dispose();
 }