-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pubsub support for per-operation options #7689
Comments
I need this to fix the x-goog-user-project anyway. |
What is supposed to happen to the options used to initialize a |
At least they should be returned by the In the generated google-cloud-cpp/generator/internal/connection_impl_generator.cc Lines 112 to 116 in 2a40c30
In the Spanner |
I have not been following the ins and outs of this feature as I should. This bug is asking me to: Save all the options, with their defaults, at the In Pub/Sub some of the options are only used while constructing the google-cloud-cpp/google/cloud/pubsub/publisher_connection.cc Lines 141 to 148 in 207a602
or this: google-cloud-cpp/google/cloud/pubsub/publisher_connection.cc Lines 89 to 100 in 207a602
I suppose we would need to document which options can have an effect on a per-call basis? |
Yes, we did modify the procedure, and no, I did not update this bug [ENOMEM]. At the
Yes. That's the same for all services I reckon. In the Spanner example from above, the
Yes, I suppose so. I hope that it would be clear where particular options are applied, and hence when overriding values has an effect, but that may be assuming too much implementation knowledge from a user. |
Addendum: Please also ensure that the |
I am still unsure what to do about |
After thinking some more about, and looking at the code, I don't think it makes sense to implement this feature for I am closing this. |
Add an
Options options = {}
argument to the constructor of the client class(es). Merge these options with the default options for the service, and store them as a member of the client class.Add an
Options options = {}
argument to each operation within each client. These options should then be merged with the client options from above, and installed as the prevailing options for the duration of the operation by instantiating aninternal::OptionsSpan
.You could then use
internal::CurrentOptions()
to obtain (aconst&
to) the prevailing options from anywhere you might need them. Any cleanup for call paths whereOptions
have been passed explicitly is discretionary.Similar support for the generated client classes was added in #7683, so you might be able to use that as an example.
The text was updated successfully, but these errors were encountered: