keepAlive

Available in a dev version: 0․11․0-grpc-186

How to configure

Configures keep-alive settings for the gRPC client.

Keep-alive allows you to fine-tune the behavior of the client to ensure the connection between the client and server remains active according to specific parameters.

By default, keep-alive is disabled.

GrpcClient("localhost", 50051) {
keepAlive {
time = 10.seconds
timeout = 20.seconds
withoutCalls = false
}
}

Parameters

configure

A lambda to apply custom configurations to the KeepAlive instance. The KeepAlive settings include:

  • time: The maximum amount of time that the channel can be idle before a keep-alive ping is sent.

  • timeout: The time allowed for a keep-alive ping to complete.

  • withoutCalls: Whether to send keep-alive pings even when there are no outstanding RPCs on the connection.

See also