ostinelli / apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
MIT License
479 stars 94 forks source link

Trouble resending notifications after socket error #62

Closed tboyko closed 6 years ago

tboyko commented 6 years ago

I assume I am somehow getting in my own way here, but would appreciate any advice that you can provide.

I am currently using the recommended connection.on(:error) do |exception| callback to catch socket errors and re-attempt sending push notifications using .push_async. These exceptions are fairly common in my setup, usually due to a DNS resolution error or closed connection. I am not using a background worker like DelayedJob or similar.

The problem I am experiencing is that .push_async blocks when I attempt to resend a notification. The apnotic documentation states that the underlying connection will be automatically repaired, but this does not seem to be the case. Perhaps this is only in the context of a background worker engine that causes the connection object to be completely reinitialized?

One additional note: I am not using a ConnectionPool currently, though I do not believe this affects the situation one way or the other.

tboyko commented 6 years ago

Possibly related to #63

ostinelli commented 6 years ago

Did that solve your issue?

tboyko commented 6 years ago

We ended up changing our codebase to use a different library. I will close this issue since no one else is participating in it.