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

MailChimpClient reuse connection pool and keep-alive #148

Open
xmedeko opened this issue Aug 29, 2017 · 1 comment
Open

MailChimpClient reuse connection pool and keep-alive #148

xmedeko opened this issue Aug 29, 2017 · 1 comment

Comments

@xmedeko
Copy link

xmedeko commented Aug 29, 2017

MailChimpClient open a new connection for every request. It's faster to reuse the connection pool and keep-alive. So, the MailChimpClient should open and keep the requests session.
Also, if the MailChimpClient would implement the session, then it should have some close() and/or __exit__() methods to close the session manually.

@xmedeko xmedeko changed the title MailChimpClient resuse connection pool and keep-alive MailChimpClient reuse connection pool and keep-alive Sep 20, 2017
@xmedeko
Copy link
Author

xmedeko commented Sep 20, 2017

I have tried to patch MailChimp class to use just one session and it has lead to about 1/3 speedup on my development machine. I can make a PR to use a session in the MailChimpClient. However, I think the MailChimp should not be child of MailChimpClient. It should use MailChimpClient as a fields only (inheritance vs. composition). Then it would be possible to switch different implementations of MailChimpClient.

Nevertheless, most of the use cases may be solved by batch processing.

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

1 participant