Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling APN with delay #83

Open
ChannyAzar opened this issue Aug 26, 2014 · 5 comments
Open

Handling APN with delay #83

ChannyAzar opened this issue Aug 26, 2014 · 5 comments

Comments

@ChannyAzar
Copy link

We have a worker that sends push notification for a given push ID.
The worker gets messages and sends PN according to the data.

The problem:
Sometimes the PN server responds with big delay. It got stuck in a middle of sending PN (maybe they limit number of APNS). It can take about an hour or more, and then, the PN is sent successfully and the queue started polling messages again..
But in this time, the worker can't push any message from the queue, so we have a big delay also for the other devices.

Is there a timeout option to Grocer.pusher ? (It's not appears in documentation)
Any other idea how to handle this?

@stevenharman
Copy link
Member

Could you expand a bit on

Sometimes the PN server responds with big delay. It got stuck in a middle of sending PN

We currently use a non-blocking write and we read feedback off a different connection - I'm curious how you've detected the "delay?"

@ChannyAzar
Copy link
Author

I'm following the logs. I saw it stuck in the line of pusher.push(notification).
After the delay, it prints the next log - after the above line.
During this delay - the worker can't push any message.

@ChannyAzar
Copy link
Author

Is there a timeout option to Grocer.pusher that drops the connection? (It's not appears in documentation), or you use a regular Timeout module of ruby http://www.ruby-doc.org/stdlib-1.9.3/libdoc/timeout/rdoc/Timeout.html?

@stevenharman
Copy link
Member

We do not have a timeout feature in Grocer, but you could use Timeout to do it yourself. That said, I've not heard of other folks having this problem - I wonder if there's a way to reach out to Apple to see if they can provide any insight.

@ChannyAzar
Copy link
Author

It can be a very useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants