|
|
@ -387,8 +387,6 @@ namespace Grpc.Core.Internal |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void Initialize(CompletionQueueSafeHandle cq) |
|
|
|
private void Initialize(CompletionQueueSafeHandle cq) |
|
|
|
{ |
|
|
|
|
|
|
|
using (Profilers.ForCurrentThread().NewScope("AsyncCall.Initialize")) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
var call = CreateNativeCall(cq); |
|
|
|
var call = CreateNativeCall(cq); |
|
|
|
|
|
|
|
|
|
|
@ -396,11 +394,8 @@ namespace Grpc.Core.Internal |
|
|
|
InitializeInternal(call); |
|
|
|
InitializeInternal(call); |
|
|
|
RegisterCancellationCallback(); |
|
|
|
RegisterCancellationCallback(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private INativeCall CreateNativeCall(CompletionQueueSafeHandle cq) |
|
|
|
private INativeCall CreateNativeCall(CompletionQueueSafeHandle cq) |
|
|
|
{ |
|
|
|
|
|
|
|
using (Profilers.ForCurrentThread().NewScope("AsyncCall.CreateNativeCall")) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if (injectedNativeCall != null) |
|
|
|
if (injectedNativeCall != null) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -418,7 +413,6 @@ namespace Grpc.Core.Internal |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure that once cancellationToken for this call is cancelled, Cancel() will be called. |
|
|
|
// Make sure that once cancellationToken for this call is cancelled, Cancel() will be called. |
|
|
|
private void RegisterCancellationCallback() |
|
|
|
private void RegisterCancellationCallback() |
|
|
@ -456,8 +450,6 @@ namespace Grpc.Core.Internal |
|
|
|
// NOTE: because this event is a result of batch containing GRPC_OP_RECV_STATUS_ON_CLIENT, |
|
|
|
// NOTE: because this event is a result of batch containing GRPC_OP_RECV_STATUS_ON_CLIENT, |
|
|
|
// success will be always set to true. |
|
|
|
// success will be always set to true. |
|
|
|
|
|
|
|
|
|
|
|
using (Profilers.ForCurrentThread().NewScope("AsyncCall.HandleUnaryResponse")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
TaskCompletionSource<object> delayedStreamingWriteTcs = null; |
|
|
|
TaskCompletionSource<object> delayedStreamingWriteTcs = null; |
|
|
|
TResponse msg = default(TResponse); |
|
|
|
TResponse msg = default(TResponse); |
|
|
|
var deserializeException = TryDeserialize(receivedMessage, out msg); |
|
|
|
var deserializeException = TryDeserialize(receivedMessage, out msg); |
|
|
@ -497,7 +489,6 @@ namespace Grpc.Core.Internal |
|
|
|
|
|
|
|
|
|
|
|
unaryResponseTcs.SetResult(msg); |
|
|
|
unaryResponseTcs.SetResult(msg); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Handles receive status completion for calls with streaming response. |
|
|
|
/// Handles receive status completion for calls with streaming response. |
|
|
|