Skip to content
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

Creation of new OkHttpClients instead of reusing one #138

Open
Legion1900 opened this issue Oct 10, 2020 · 2 comments
Open

Creation of new OkHttpClients instead of reusing one #138

Legion1900 opened this issue Oct 10, 2020 · 2 comments

Comments

@Legion1900
Copy link

Legion1900 commented Oct 10, 2020

Erc20Kit can work with only one token at a time. Each instance of Erc20Kit requires new TransactionManager which in turn requires EtherscanTransactionsProvider which needs EtherscanService. Each new EtherscanService creates new instance of OkHttpClient which is resource-heavy. Is there some specific reason for it?

It would be great if users will be able to provide OkHttpClient through class constructors as it allows proper resource management on app level.

@abdrasulov
Copy link
Member

Hi @Legion1900. Thanks for your interest. That's a good point. We will work on this soon

@Legion1900
Copy link
Author

For our project we made these hotfixes of InfuraService.kt and EtherscanService.kt. Basically we changed visibility of Retrofit services from internal to public and modified service constructors so that they accept built services.

Hope this can be helpful

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

No branches or pull requests

2 participants