Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Expose field mask interceptor utility #99

Open
calbach opened this issue Jun 27, 2016 · 1 comment
Open

Expose field mask interceptor utility #99

calbach opened this issue Jun 27, 2016 · 1 comment

Comments

@calbach
Copy link
Contributor

calbach commented Jun 27, 2016

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.

@pgrosu
Copy link

pgrosu commented Jun 27, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants