-
Notifications
You must be signed in to change notification settings - Fork 172
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
[Feature request] Connection pool #44
Comments
But does the library actually open-close connections constantly? My understanding was that connection is left opened after the first push, and then you can reuse it as many times as you want from as many threads as you want. Thread-safety assumption comes from hyper package changelog (used for HTTP20Connection class):
And as it is a HTTP/2 connection, library heavily reuses streams inside a single connection, which per my understanding is not the same as a connection pool of course, but gives you similar benefits. Maybe the author could comment more on that. |
@vinnyspb, good point! I missed out the fact that PyAPNs2 relies on http20, so I was expecting to see code managing connection at the PyAPNs2 library level and I didn't see any. As it turns out, I checked out the source code of the http20 package after seeing your comment, the connection management has already been well taken care of by http20. Thanks for your insight. |
I'm concerned there may be thread-safety issues. For example, |
Excerpt from the official docs on Best Practices for Managing Connections,
I think it's the best for apns2-client library to conform to this best practice, in order to avoid the possibility of having the services built with the library being seeing as a denial-of-service attack and thus interruption to those services. Therefore, I think we should add a connection pool for managing the reuse of open connections to this library.
Thanks for developing this library. It has been working great for me and its code is easy to read and follow.
The text was updated successfully, but these errors were encountered: