Skip to content

Commit b3984e1

Browse files
authored
Pass cancellation token to grpc reader (#2133)
1 parent d7e9f80 commit b3984e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Proto.Remote/Endpoints/ServerConnector.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ await call.RequestStream.WriteAsync(new RemoteMessage
174174

175175
var writer = StartWriter(combinedToken, call, cancellationTokenSource);
176176

177-
var reader = StartReader(call, actorSystemId, cancellationTokenSource);
177+
var reader = StartReader(combinedToken, call, actorSystemId, cancellationTokenSource);
178178

179179
_logger.LogInformation("[ServerConnector][{SystemAddress}] Connected to {Address}", _system.Address,
180180
_address);
@@ -299,13 +299,13 @@ private Task StartWriter(CancellationToken combinedToken, AsyncDuplexStreamingCa
299299
});
300300
}
301301

302-
private Task StartReader(AsyncDuplexStreamingCall<RemoteMessage, RemoteMessage> call, string actorSystemId, CancellationTokenSource cancellationTokenSource)
302+
private Task StartReader(CancellationToken combinedToken, AsyncDuplexStreamingCall<RemoteMessage, RemoteMessage> call, string actorSystemId, CancellationTokenSource cancellationTokenSource)
303303
{
304304
return Task.Run(async () =>
305305
{
306306
try
307307
{
308-
while (await call.ResponseStream.MoveNext().ConfigureAwait(false))
308+
while (await call.ResponseStream.MoveNext(combinedToken).ConfigureAwait(false))
309309
{
310310
// if (_endpoint.CancellationToken.IsCancellationRequested) continue;
311311
var currentMessage = call.ResponseStream.Current;

0 commit comments

Comments
 (0)