open-traffic-generator / snappi

Open Traffic Generator SDK in Python and Go
MIT License
70 stars 7 forks source link

GRPCTransport should support arbitrary dial options #192

Closed greg-dennis closed 1 year ago

greg-dennis commented 1 year ago

When dialing a gRPC endpoint, normally a client can provide arbitrary dial options. Ondatra currently has a use case for providing a custom unary and stream interceptor, for example. GRPCTransport could in theory provide setters for all DialOptions that currently exist but that would bloat the API and would incur the burden of keeping it up to date when new dial options are added. I'd suggest a simple SetDialOptions(...grpc.DialOption) method be added. Whether or not you still want to keep SetDialTimeout or leave it up to the user to set it via a dial option is up to you. If both SetDialTimeout and SetDialOptions are available, then some reasonable semantics for when both are set would need to be decided.

ashutshkumr commented 1 year ago

@greg-dennis could you please let us know if this works for you ? https://github.com/open-traffic-generator/openapiart/issues/328

greg-dennis commented 1 year ago

@ashutshkumr, I confirmed that this is sufficient for my use case, thank you.