argon/node-apn — pull request #134 by ejc3 (2013-10-30 11:26:57+00:00)
Title: Update connection.js to support a "shutdown" command

This change adds a shutdown method to Connection that indicates to socketDrained that it should close connections once there are no more notifications to send. This allows APN to be run as part of a standalone program (e.g. a program that reads a list of notifications from a file). I've tested the change both with all successful messages, as well as when a few messages can't be sent. In both cases, the program does not shutdown until all messages that can be successfully sent our sent.