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

Thoughts on possible ClientConnPool #21

Closed
imhoffd opened this issue Apr 29, 2016 · 3 comments
Closed

Thoughts on possible ClientConnPool #21

imhoffd opened this issue Apr 29, 2016 · 3 comments

Comments

@imhoffd
Copy link
Contributor

imhoffd commented Apr 29, 2016

Unless I'm misunderstanding something, it would make sense to provide a client pool for APNS connections. It would be helpful for those who use this lib with multiple certificates.

My understanding is the ClientConnPool in the http2 libs cannot be used because the underlying Transport is used across all clients in the pool. That wouldn't work for this lib, as the TLS connection is configured with the Apple certificate for each client's transport.

If this is deemed a good idea and a possibility, I'd be willing to start a PR.

@sideshow
Copy link
Owner

sideshow commented May 1, 2016

I think this is an awesome idea and something i wanted to get to, so a PR would be welcome!

@c3mb0
Copy link
Contributor

c3mb0 commented May 2, 2016

Just to validate this need and offer a PoC, we are currently doing this with a sync.RWLock controlled map[string]*apns.Client where string is the certificate's file name. Would be a good addition to the package.

@imhoffd
Copy link
Contributor Author

imhoffd commented May 2, 2016

@c3mb0 That's basically what we're doing, except our key is a md5 of the certificate bytes. I will attempt to integrate our solution to the library and submit a PR this week.

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

No branches or pull requests

3 participants