-
Notifications
You must be signed in to change notification settings - Fork 47
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
Hanging on send() #46
Comments
That's odd. All Send does is add the message to an internal channel. When you use NewClientWithFiles it also launches a goroutine with a RunLoop waiting to pull messages off that channel. I'm not sure what's happening here yet. |
We're doing a blocking send on the The alternative is to use the select {
case c.notifs <- n:
return nil;
default:
// Send would block, drop the notification.
return ErrNotificationDropped
} or this: select {
case c.notifs <- n:
default:
// Send would block, drop the notification.
if c.DropHandler != nil {
c.DropHandler(n)
}
} |
Only read this comment if you're in the mood for crazy talk that isn't roadmapped and may never materialize: Idea: the "drop" case could be used as a signal to open additional connections to the APNS gateway as needed for dealing with heavy load. |
Yes, I'm just not sure why notifs would be blocking if there is only one notification being sent as in the example. @ynnadkrap Is there more to that example than you are showing? |
c.Send(m) isn't returning and I'm not sure why. I created a client without error and am not receiving any errors on sent PNs.
The text was updated successfully, but these errors were encountered: