【发布时间】:2020-12-04 01:39:57
【问题描述】:
我正在尝试异步创建一个新的 AsyncUnaryCall 实例,该实例包装了原始接收的实例。
问题是拦截器基类的设计不佳,它不允许异步方法拦截器。 (如此处所述:https://github.com/grpc/grpc-dotnet/issues/694)
为了得到这个想法,这是想要实现的目标:
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, AsyncUnaryCallContinuation<TRequest, TResponse> continuation)
{
var result = await MyAsyncStuff(); // if we can not await, what is the alternative?
return new AsyncUnaryCall<TResponse>(paramters);
}
【问题讨论】:
标签: c# asp.net-core grpc-dotnet