提交 fd705785 编写于 作者: S Shen Chen

Change hang to blocking

上级 7a36f748
......@@ -138,8 +138,8 @@ public override async ValueTask<Optional<TResult>> TryInvokeAsync<TResult>(Solut
var (clientStream, serverStream) = FullDuplexStream.CreatePair();
// Create new tasks that both start executing, rather than invoking the delegates directly.
// If the reader started synchronously reading before the writer task started it would hang, and vice versa
// if the writer synchronously filled the buffer before the reader task started it would also hang.
// If the reader started synchronously reading before the writer task started it would be blocking, and vice versa
// if the writer synchronously filled the buffer before the reader task started it would also be blocking.
var writerTask = Task.Run(async () => await invocation(service, serverStream, cancellationToken).ConfigureAwait(false), cancellationToken);
var readerTask = Task.Run(async () => await reader(clientStream, cancellationToken).ConfigureAwait(false), cancellationToken);
await Task.WhenAll(writerTask, readerTask).ConfigureAwait(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册