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(); } }
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(); } }