Class ProtoGrpcBlockingClient
The synchronous facade of a ProtoGrpcClient: callers whose test code cannot await use it to open streaming calls. Each member blocks the calling thread while authenticators and the channel are prepared, running the async work on the pool with no captured synchronization context, so an authenticator that awaits cannot deadlock against the blocked caller. Prefer OpenServerStreamingAsync<TRequest, TResponse>(Method<TRequest, TResponse>, TRequest, Action<Metadata>?, DateTime?, CancellationToken) and OpenDuplexStreamingAsync<TRequest, TResponse>(Method<TRequest, TResponse>, Action<Metadata>?, DateTime?, CancellationToken) where the test can await.
public sealed class ProtoGrpcBlockingClient
- Inheritance
-
ProtoGrpcBlockingClient
- Inherited Members
- Extension Methods
Constructors
ProtoGrpcBlockingClient(ProtoGrpcClient)
The synchronous facade of a ProtoGrpcClient: callers whose test code cannot await use it to open streaming calls. Each member blocks the calling thread while authenticators and the channel are prepared, running the async work on the pool with no captured synchronization context, so an authenticator that awaits cannot deadlock against the blocked caller. Prefer OpenServerStreamingAsync<TRequest, TResponse>(Method<TRequest, TResponse>, TRequest, Action<Metadata>?, DateTime?, CancellationToken) and OpenDuplexStreamingAsync<TRequest, TResponse>(Method<TRequest, TResponse>, Action<Metadata>?, DateTime?, CancellationToken) where the test can await.
public ProtoGrpcBlockingClient(ProtoGrpcClient client)
Parameters
clientProtoGrpcClient
Methods
DuplexStreaming<TRequest, TResponse>(Method<TRequest, TResponse>, Action<Metadata>?, DateTime?, CancellationToken)
Opens a duplex-streaming call, blocking until it is ready.
public AsyncDuplexStreamingCall<TRequest, TResponse> DuplexStreaming<TRequest, TResponse>(Method<TRequest, TResponse> method, Action<Metadata>? metadata = null, DateTime? deadline = null, CancellationToken cancellationToken = default) where TRequest : class where TResponse : class
Parameters
methodMethod<TRequest, TResponse>metadataAction<Metadata>deadlineDateTime?cancellationTokenCancellationToken
Returns
- AsyncDuplexStreamingCall<TRequest, TResponse>
Type Parameters
TRequestTResponse
ServerStreaming<TRequest, TResponse>(Method<TRequest, TResponse>, TRequest, Action<Metadata>?, DateTime?, CancellationToken)
Opens a server-streaming call, blocking until it is ready.
public AsyncServerStreamingCall<TResponse> ServerStreaming<TRequest, TResponse>(Method<TRequest, TResponse> method, TRequest request, Action<Metadata>? metadata = null, DateTime? deadline = null, CancellationToken cancellationToken = default) where TRequest : class where TResponse : class
Parameters
methodMethod<TRequest, TResponse>requestTRequestmetadataAction<Metadata>deadlineDateTime?cancellationTokenCancellationToken
Returns
- AsyncServerStreamingCall<TResponse>
Type Parameters
TRequestTResponse