You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you probably know, Sidekiq runs in a multithreaded environment. I believe calling APN.notify_sync from multiple threads will still cause a race condition for the conditional assignment and creation of the client.
This is a race-condition that theoretically could happen, but I was not able to simulate yet... we use in production with Sidekiq without any problems so far.
https://github.com/arthurnn/apn_sender/blob/master/lib/apn/connection.rb#L5
As you probably know, Sidekiq runs in a multithreaded environment. I believe calling APN.notify_sync from multiple threads will still cause a race condition for the conditional assignment and creation of the client.
APN::Client
itself is already lazily opening a socket connect, so in my opinion it does not hurt to initialize the ConnectionPool in an earlier stage.Another interesting idea is to see if the APN::Client could be a Celluloid::Actor of its own.
The text was updated successfully, but these errors were encountered: