THRIFT-5210 further refactoring and performance optimizations
Client: netstd
Patch: Jens Geyer
This closes #2146
diff --git a/lib/netstd/Thrift/Server/TServer.cs b/lib/netstd/Thrift/Server/TServer.cs
index f40f2b7..3fd0bc5 100644
--- a/lib/netstd/Thrift/Server/TServer.cs
+++ b/lib/netstd/Thrift/Server/TServer.cs
@@ -76,12 +76,10 @@
// do nothing
}
- public virtual async Task ServeAsync(CancellationToken cancellationToken)
+ public virtual Task ServeAsync(CancellationToken cancellationToken)
{
- if (cancellationToken.IsCancellationRequested)
- {
- await Task.FromCanceled(cancellationToken);
- }
+ cancellationToken.ThrowIfCancellationRequested();
+ return Task.CompletedTask;
}
}
}