ZhukV/AppleApnPush — pull request #8 by popthestack (2013-07-10 16:50:45+00:00)
Title: Ability to disable error checking when sending notifications

I noticed when sending thousands of notifications at a time that the isReadyRead() caused a huge slowdown, as its default is to wait 1 second after every notification. I know the amount of time it waits can be changed, but sometimes I'd rather disable the error checks completely.

The PHP stream_select() documentation states the following:

Using a timeout value of 0 allows you to instantaneously poll the status
of the streams, however, it is NOT a good idea to use a 0 timeout value
in a loop as it will cause your script to consume too much CPU time.

It is much better to specify a timeout value of a few seconds, although
if you need to be checking and running other code concurrently, using
a timeout value of at least 200000 microseconds will help reduce the
CPU usage of your script.

I could change the wait to 0.2 seconds, per the recommendation, but sometimes I simply don't care if a message here or there fails and I'd rather have the speed that comes without checking for errors.