unary<I, O> function

Future<O> unary<I, O>(
  1. Transport transport,
  2. Method method,
  3. I request,
  4. Codec<I> input,
  5. Codec<O> output, {
  6. CallOptions options = const CallOptions(),
})

Implementation

Future<O> unary<I, O>(Transport transport, Method method, I request,
    Codec<I> input, Codec<O> output,
    {CallOptions options = const CallOptions()}) async {
  final call = await transport.open(method, options: options);
  try {
    await call.send(input.encode(request));
    await call.halfClose();
    return await _single(call, output);
  } finally {
    await call.close();
  }
}