我正在尝试异步创建一个新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);
}