djacobs / PyAPNs

Python library for interacting with the Apple Push Notification service (APNs)
http://pypi.python.org/pypi/apns/
MIT License
1.22k stars 374 forks source link

APNS to support error-response handling(enhanced message) and re-send mechanism for performance #61

Closed jimhorng closed 10 years ago

jimhorng commented 10 years ago

The problem of current APNS error-response are: (reference: the problem, official doc -> The Binary Interface and Notification Format)

From my experiment of getting error-response with enhanced message format:

The solution suggested in the problem is to save sent notification in a queue with no timeout(or minimum), when error-response caught, pop out messages before the error one in queue (considered successfully sent), and re-sent others. Which will not have performance concern if waiting for error-response in fixed time for each message sent, and also prevent error-response uncaught.

hagino3000 commented 10 years ago

I'm using PyAPNs to send 1,000,000 devices/day. And my workarounds are

Code is here https://github.com/voyagegroup/apns-proxy-server/blob/065775f87dbf25f6b06f24edc73dc5de4481ad36/apns_proxy_server/worker.py#l164-209

Then my idea is 2 phase

(1) Add error handling methods for manual use

We can check error-respose any time.

(2) Provide automatic error handling mode

djacobs commented 10 years ago

@jimhorng - do you want to make a pull request?