-
Notifications
You must be signed in to change notification settings - Fork 283
How do we set Pipelines options to a Client? #591
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
Comments
Passing in a transport is about the lowest-level operation our other language SDKs provide. This is useful for testing, or for really customizing the headers, etc. But other pipeline options like number of retries, the retry policy, headers and query parameters logged, how much information is logged, etc., is a fairly established pattern in the other SDKs (though different idiomatically) we should mimic in concept. This is what I did with the azure_core::ClientOptions class as shown in an example here: azure-sdk-for-rust/sdk/core/src/options.rs Lines 12 to 17 in c4257f7
Was there some specific problems with this? This pattern was also discussed within the v-team back when I submitted the PR. /cc @yoshuawuyts |
I'm keen to get feedback on the proposal I put out in #531 (comment). What do people think of this direction?
|
If we wanted to eliminate the The |
@JeffreyRichter any thoughts here based on other native SDKS? |
In Python, for example, you provide key/value pairs to set general pipeline options via If we go this route, how do we enforce it? Does |
What we want is for Core to define a common set of policies and their options. And then, we also need to let service clients add service-specific policies & options. In languages that support inheritance, Core has an options struct/class with what's in Core and service clients create their own options that derive off the Core options. In go, we don't have inheritance and so we embed Core's options inside the service's client's options as a field. In Rust, since we can't easily initiate the fields and add new fields in a backward compatible way, we've been using the builder pattern. This means that every service client options needs to wrap Core's Options and re-implement the methods that set individual policy options - this is unfortunate for the Microsoft engineer but is a good customer experience. |
@yoshuawuyts also worth taking a look at the original discussion item #300. Perhaps superseded by this, but would be good to consolidate on a single discussion issue (whichever is fine). |
One concern I have with hanging client options-setting methods off a client itself (like your When we start getting "too many methods" (it's rather subjective) we start creating "subclients" or "operation groups". Our older track 1 libraries had these a lot, and we're still deciding at an archboard level how these will look on our track 2 libraries (all the Azureprefixed libraries, basically, instead of Microsoft.Azure). |
The draft PR presented one option & other options were discussed in comments.
The text was updated successfully, but these errors were encountered: