Open calbach opened 8 years ago
That's a really good idea, and would definitely save some time! Currently a ManagedChannel
is generated with empty fields, upon which a stub gets added afterwards for each type of request service containing the appropriate fields built up via interceptors through a Metadata
type.
Separating the logic of setting the fields via a returned Metadata
object, and then feeding that to an updateStub
method that would overwrite the current stub would make the current implementation a bit easier to read and probably manage as well :)
Thanks, ~p
I wound up using
stub.withInterceptors()
in a project to avoid opening a new channel every time I wanted different field masks; I wound up copy-pasting from https://github.com/googlegenomics/utils-java/blob/master/src/main/java/com/google/cloud/genomics/utils/grpc/GenomicsChannel.java#L75. Would be nice to expose the field mask interceptor logic via a public utility as I believe the current library only allows setting up a field mask while also creating a new channel.