5 ms·
Hey, you do know that Apple requires developers to maintain persistent connections to their servers, right? Checkout https://github.com/jnak/apnmachine https:/
by juliennakache 14y ago
Hey, you do know that Apple requires developers to maintain persistent connections to their servers, right?
Checkout https://github.com/jnak/apnmachine https://github.com/jnak/apnmachine
Feature list:
- persistent connection to APN Servers (as Apple recommends)
- real-time notifications (no regular polling a la Resque)
- super easy to use in Ruby and any languages (as easy as enqueuing a serialized JSON hash in Redis)
- persist and queue messages when server is down
- horizontal scalability and out-of-the-box load-balancing
- fast daemons
- vanstee 14y agoNice! We keep a single connection open using the standalone gem. But yeah you're right it would be an issue if you were connecting to Apple's servers in a resque worker for example, since the socket would be opened in a new child for each job. I bet you could get around this though by opening a socket in the parent and using it in each child process. Reconnecting might be a little trickier though. apnmachine looks pretty sweet. I'll have to check it out if I need something like that in the future.
- juliennakache 14y agoDon't know the standalone gem, I'll have to check that out. I'll be glad to get some feedback on apnmachine :)
- stevenharman 14y ago> the standalone gem @vanstee is referring the Grocer being a RubyGem and not needing other dependencies like Resque.
- gmac 14y agoThis was exactly my thought, and having followed the link I'm not clear how (or even whether) this gem solves it. I currently use the Python/Twisted-based https://github.com/samuraisam/pyapns https://github.com/samuraisam/pyapns in production. It looks a bit abandoned, but it has a Ruby client and has been rock-solid for me.