Class ApiServerStreamingCall<TRequest, TResponse>
Bridge between a server streaming RPC method and higher level abstractions, applying call settings as required.
Inheritance
Inherited Members
Namespace: Google.Api.Gax.Grpc
Assembly: Google.Api.Gax.Grpc.dll
Syntax
public sealed class ApiServerStreamingCall<TRequest, TResponse>
Type Parameters
| Name | Description |
|---|---|
| TRequest | RPC request type |
| TResponse | RPC response type |
Properties
BaseCallSettings
The base CallSettings for this API call; these can be further overridden by providing
a CallSettings to Call(TRequest, CallSettings).
Declaration
public CallSettings BaseCallSettings { get; }
Property Value
| Type | Description |
|---|---|
| CallSettings |
Methods
Call(TRequest, CallSettings)
Initializes a streaming RPC call.
Declaration
public AsyncServerStreamingCall<TResponse> Call(TRequest request, CallSettings perCallCallSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| TRequest | request | The RPC request. |
| CallSettings | perCallCallSettings | The call settings to apply to this specific call, overriding defaults where necessary. |
Returns
| Type | Description |
|---|---|
| AsyncServerStreamingCall<TResponse> | A gRPC duplex streaming call object. |
CallAsync(TRequest, CallSettings)
Initializes a streaming RPC call asynchronously.
Declaration
public Task<AsyncServerStreamingCall<TResponse>> CallAsync(TRequest request, CallSettings perCallCallSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| TRequest | request | The RPC request. |
| CallSettings | perCallCallSettings | The call settings to apply to this specific call, overriding defaults where necessary. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<AsyncServerStreamingCall<TResponse>> | A task representing the gRPC duplex streaming call object. |
WithCallSettingsOverlay(Func<TRequest, CallSettings>)
Constructs a new ApiServerStreamingCall<TRequest, TResponse> that applies an overlay to the underlying CallSettings. If a value exists in both the original and the overlay, the overlay takes priority.
Declaration
public ApiServerStreamingCall<TRequest, TResponse> WithCallSettingsOverlay(Func<TRequest, CallSettings> callSettingsOverlayFn)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<TRequest, CallSettings> | callSettingsOverlayFn | Function that builds the overlay CallSettings. |
Returns
| Type | Description |
|---|---|
| ApiServerStreamingCall<TRequest, TResponse> | A new ApiServerStreamingCall<TRequest, TResponse> with the overlay applied. |
WithGoogleRequestParam(String, Func<TRequest, String>)
Constructs a new ApiServerStreamingCall<TRequest, TResponse> that applies an x-goog-request-params header to each request, using the specified parameter name and a value derived from the request.
Declaration
public ApiServerStreamingCall<TRequest, TResponse> WithGoogleRequestParam(string parameterName, Func<TRequest, string> valueSelector)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | parameterName | The parameter name in the header. Must not be null. |
| System.Func<TRequest, System.String> | valueSelector | A function to call on each request, to determine the value to specify in the header. The parameter must not be null, but may return null. |
Returns
| Type | Description |
|---|---|
| ApiServerStreamingCall<TRequest, TResponse> | A new ApiServerStreamingCall<TRequest, TResponse> which applies the header on each request. |
Remarks
Values produced by the function are URL-encoded; it is expected that parameterName is already URL-encoded.