News for hackers. Stuff that matters.
Re:Grocer - New Gem for Sending Apple Push Notifications in ... by juliennakache on Tuesday June 12, 2012 @06:47PM (#4103360)
Hey, you do know that Apple requires developers to maintain persistent connections to their servers, right?

Checkout 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

Re:Grocer - New Gem for Sending Apple Push Notifications in ... by vanstee on Tuesday June 12, 2012 @06:56PM (#4103388)
Nice! 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.

Re:Grocer - New Gem for Sending Apple Push Notifications in ... by juliennakache on Tuesday June 12, 2012 @07:19PM (#4103448)
Don't know the standalone gem, I'll have to check that out. I'll be glad to get some feedback on apnmachine :)
Re:Grocer - New Gem for Sending Apple Push Notifications in ... by stevenharman on Tuesday June 12, 2012 @07:54PM (#4103570)
> the standalone gem

@vanstee is referring the Grocer being a RubyGem and not needing other dependencies like Resque.

Re:Grocer - New Gem for Sending Apple Push Notifications in ... by gmac on Wednesday June 13, 2012 @08:33AM (#4105508)
This 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 in production. It looks a bit abandoned, but it has a Ruby client and has been rock-solid for me.