Pr0Ger / PyAPNs2

Python library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol
MIT License
349 stars 179 forks source link

Support sending notifications in batch. #27

Closed matangover closed 7 years ago

matangover commented 7 years ago

The APNs HTTP/2 API supports sending notifications across multiple HTTP/2 streams simultaneously. Up until now, PyAPNs2 has only supported one stream at a time, which is unbearably slow when pushing a notification to thousands of tokens or more. Using multiple streams has speeded up our push notification sending from about 4 tokens per second to 400-500 tokens per second, a speedup of over 100x. We have used it many times in production and it has proved reliable. We use Python 2.7 but I have attempted to make sure it's compatible with Python 3 as well. The tests and pylint pass on 2.7 as well as on 3.5.

matangover commented 7 years ago

@Pr0Ger ❓

Pr0Ger commented 7 years ago

Hello, Sorry for a long response, I was busy last weeks. Thanks for such a great PR with new feature, docs and tests. I'll merge it now and ship update to PyPI soon