-
Notifications
You must be signed in to change notification settings - Fork 33
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
Provide getter for OkHttpClient and method to provide one to the SquareClient.Builder #3
Comments
Hello, it is in our future road map allow users to configure pass in their own http client. Until then, I am sorry to say your app might have to operate with two OkHttpClients. |
ah so I discovered you can aggressively shutdown the underlying OkHttpClient instance by calling |
just hit another use case where I need the client- I would like to register an interceptor on the client created by the SDK so I can capture response time metrics as described here: https://square.github.io/okhttp/interceptors/ |
@jfinci Thought the SquareClient is final, does wrapping it so you can do your interception work for you? You could also use AspectJ to intercept calls. Not sure if that gets you what you want, but it might. We do have a task on our roadmap to support providing your own HTTP client, but we can't commit to a date at this time. |
I've implemented my own |
We now have interfaces for these objects with the intent of allowing developers to implement whatever they so choose. This should allow more flexibility and customization. |
I think this needs to be reopened. Setup a meeting with me if you want to discuss more. Its great that you have a interface, but, I don't want to reimplement the entire |
In order to use my own client i also need to copy pasta ALL of |
hey @finci-square I've been told that our SDK supports this now, and you could achieve it by doing the following.
you can then get the method from the square client with
Let me know if that solves the issue, and we can close this ticket Cheers! |
Two reasons:
The text was updated successfully, but these errors were encountered: