|
|
|
@ -44,6 +44,8 @@ namespace Grpc.Core |
|
|
|
|
public static class Calls |
|
|
|
|
{ |
|
|
|
|
public static TResponse BlockingUnaryCall<TRequest, TResponse>(Call<TRequest, TResponse> call, TRequest req, CancellationToken token) |
|
|
|
|
where TRequest : class
|
|
|
|
|
where TResponse : class
|
|
|
|
|
{ |
|
|
|
|
var asyncCall = new AsyncCall<TRequest, TResponse>(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); |
|
|
|
|
// TODO(jtattermusch): this gives a race that cancellation can be requested before the call even starts. |
|
|
|
@ -52,6 +54,8 @@ namespace Grpc.Core |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static async Task<TResponse> AsyncUnaryCall<TRequest, TResponse>(Call<TRequest, TResponse> call, TRequest req, CancellationToken token) |
|
|
|
|
where TRequest : class
|
|
|
|
|
where TResponse : class
|
|
|
|
|
{ |
|
|
|
|
var asyncCall = new AsyncCall<TRequest, TResponse>(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); |
|
|
|
|
asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); |
|
|
|
@ -61,6 +65,8 @@ namespace Grpc.Core |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Call<TRequest, TResponse> call, TRequest req, CancellationToken token) |
|
|
|
|
where TRequest : class
|
|
|
|
|
where TResponse : class
|
|
|
|
|
{ |
|
|
|
|
var asyncCall = new AsyncCall<TRequest, TResponse>(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); |
|
|
|
|
asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); |
|
|
|
@ -71,6 +77,8 @@ namespace Grpc.Core |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Call<TRequest, TResponse> call, CancellationToken token) |
|
|
|
|
where TRequest : class
|
|
|
|
|
where TResponse : class
|
|
|
|
|
{ |
|
|
|
|
var asyncCall = new AsyncCall<TRequest, TResponse>(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); |
|
|
|
|
asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); |
|
|
|
@ -81,6 +89,8 @@ namespace Grpc.Core |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Call<TRequest, TResponse> call, CancellationToken token) |
|
|
|
|
where TRequest : class
|
|
|
|
|
where TResponse : class
|
|
|
|
|
{ |
|
|
|
|
var asyncCall = new AsyncCall<TRequest, TResponse>(call.RequestMarshaller.Serializer, call.ResponseMarshaller.Deserializer); |
|
|
|
|
asyncCall.Initialize(call.Channel, GetCompletionQueue(), call.Name); |
|
|
|
|