4
votes

How can I adjust the keepalive parameters for a Dart gRPC client?

There is a page defining keepalive options: https://github.com/grpc/grpc/blob/master/doc/keepalive.md.

It describes these as "channel arguments".

I've seen examples of this being done in Python, for example here: https://www.cs.mcgill.ca/~mxia3/2019/02/23/Using-gRPC-in-Production/

When creating a channel in Dart I use ChannelOptions(), which supports named parameters credentials, idleTimeout and backOffStrategy, e.g.

client = ClientChannel(
       'localhost',
        port: 50051,
        options: ChannelOptions(
          credentials: credentials,
          //idleTimeout: Duration(minutes: 1),
          //backOffStrategy: backOffstrategy
        ));

  }

How or where do I set the channel arguments?

1

1 Answers

2
votes

gRPC keepalive is not yet implemented. There's a tracking issue to add KeepAlive support you can upvote.