Class ProtoGrpcBlockingClient

Namespace
ProtoTest.Grpc
Assembly
ProtoTest.Grpc.dll

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

client ProtoGrpcClient

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

method Method<TRequest, TResponse>
metadata Action<Metadata>
deadline DateTime?
cancellationToken CancellationToken

Returns

AsyncDuplexStreamingCall<TRequest, TResponse>

Type Parameters

TRequest
TResponse

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

method Method<TRequest, TResponse>
request TRequest
metadata Action<Metadata>
deadline DateTime?
cancellationToken CancellationToken

Returns

AsyncServerStreamingCall<TResponse>

Type Parameters

TRequest
TResponse