Comments (3)
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):
The HTTP20Connection object is now thread-safe, so long as stream IDs are used on all method calls.
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.
from pyapns2.
@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.
from pyapns2.
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.
I'm concerned there may be thread-safety issues. For example, send_notification_batch()
doesn't seem to take into account that there may be open streams pending from other calls to that method on other threads. If I'm not mistaken, this could result in too many (or more than __max_concurrent_streams
) simultaneous requests.
from pyapns2.
Related Issues (20)
- hyper dependency is no longer maintained HOT 24
- Where's extra flag? HOT 2
- threading.Thread.setDaemon has been deprecated in favor of setting daemon attribute directly in Python 3.10 HOT 1
- How to get the response? My notification works for some device tokens but fails for other. HOT 1
- apns2 0.7.2 requires PyJWT<2.0.0,>=1.4.0, but you have pyjwt 2.1.0 which is incompatible. HOT 22
- DeviceTokenNotForTopic for voip push HOT 1
- SSL error HOT 1
- The library dependency hyper seems not compatible with 3.10 HOT 2
- send_notification_batch method discards same token result during compose batch response HOT 1
- Fail to push notification HOT 1
- AttributeError: 'PosixPath' object has no attribute 'create_connection'
- Python 3.10 compatibility HOT 3
- ssl.SSLZeroReturnError HOT 7
- Compatibility with Mac M1 (Python 3.10) HOT 3
- Vulnerability in PyJWT HOT 2
- How is set apns-id? HOT 1
- Failing to find Algorithm 'ES256' in aws lambda HOT 1
- ssl.SSLError: [SSL: BAD_LENGTH] bad length HOT 4
- Current status of project HOT 1
- Provided examples do not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyapns2.