-
Notifications
You must be signed in to change notification settings - Fork 18
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
Make api clients with interceptors cloneable #566
Conversation
Hi @sprudel While I like the idea of clonable interceptors, I don't understand why the chained interceptor should be removed. (1) it is a breaking change and (2) it was introduced to remove the need for generic and multiple impls for the client builder. Since it is duplicate code, I'd love to have only one implementation for the client builder. Otherwise, we need to maintain several implementations and things can and will go wrong when some parts are updated. |
af254df
to
d8c00e1
Compare
cc165f3
to
c53cf55
Compare
@buehler yes it is a breaking change, but when making the clients cloneable it created a lot of friction. As far as I have understood it was only introduced to make the impl of the builder easy, or was there another reason? I have iterated over the implementation and now found a way to have no code duplication by using generics in a smart way. I pushed the modified version to this branch. What do you think of this version? Still it is a fair argument to say such a breaking change is not worth it. Given #567 however, this will be needed either way. |
@buehler From my perspective this PR would be mergable. However, I'm not sure if using the generics to remove the chained interceptor still fulfills your requirements. |
This is a pretty solid implementation. Thank you @sprudel. To be honest, I didn't know enough about rust types to make this kind of changes. It serves as a good example for me now ;-) I like the implementation and how it is used. |
Make clients clonable:
Note: this is built on top of #565