ref: be1ea4613a86598e7e880b4397671b2ab2f25a63 jmp-pay/lib/blather_notify.rb -rw-r--r-- 633 bytes
Do not hang forever if shutdown fails
Wait until fully disconnected before EM.stop
Fix intermittent notification non-delivery

We need to wait until all EventMachine items in flight are complete before we
allow the process to terminate or some of them might not happen.  So when the
process wants to exit, wait until the EM thread is done.  Use next_tick to make
sure our stop command only happens when the EM queue is next clear.
Higher XMPP connect timeout

Because sometimes the box is under high load.
Notify customer when renewal fails due to low balance

This is done by sending from a configured JID to <tel>@cheogram.com in order to
have them receive a message from support.