immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.43k stars 452 forks source link

Speeding Up Sending By Using Zero for Write Interval #170

Open KristopherSmith opened 4 years ago

KristopherSmith commented 4 years ago

From sample_push_many.php lines 45-47 a comment reads:

// To speed up the sending operations, use Zero as parameter but
// some messages may be lost.

What is the technical reason for messages getting lost?

I’m looking to speed up the performance of my sending (it’s too slow for production) and after reading a Technical Note from Apple, they suggest to avoid checking for an error response every time I write. So instead of checking every time, I’m going to do it at some interval (i.e. 25,000 sends).

Knowing this, does it make sense to have a write interval in this use case? My original thought was the write interval’s purpose was to give the fread() enough time to capture an error response. But that may not be the intention, as it could be there to prevent some sort of sending limit via the socket.