Table of Contents

Interface IGatewayApi

Namespace
Virtufin.Api.Client
Assembly
Virtufin.Api.Client.dll

The gateway itself: service discovery and typed dispatch to a backend service.

public interface IGatewayApi

Methods

InvokeAsync<TRequest, TResponse>(string, string, TRequest, MessageParser<TResponse>, TimeSpan?, CancellationToken)

Calls method on the backend service through Gateway.Invoke, protobuf bytes in and out. A backend failure the gateway reports in-band (its status/message) is thrown as GatewayInvokeException. No JSON and no reflection: safe under NativeAOT, unlike the dynamic client.service.Method(dictionary) form. parser is the response message's Parser (e.g. CreateWorkerResponse.Parser); a null timeout leaves the deadline to the gateway's default (30 s).

Task<TResponse> InvokeAsync<TRequest, TResponse>(string service, string method, TRequest request, MessageParser<TResponse> parser, TimeSpan? timeout = null, CancellationToken cancellationToken = default) where TRequest : IMessage where TResponse : IMessage<TResponse>

Parameters

service string
method string
request TRequest
parser MessageParser<TResponse>
timeout TimeSpan?
cancellationToken CancellationToken

Returns

Task<TResponse>

Type Parameters

TRequest
TResponse

ListServicesAsync(CancellationToken)

Task<List<string>> ListServicesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<List<string>>