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

Document ClientManager and concurrent access safety #44

Closed
oliverjanik opened this issue Oct 4, 2016 · 2 comments
Closed

Document ClientManager and concurrent access safety #44

oliverjanik opened this issue Oct 4, 2016 · 2 comments

Comments

@oliverjanik
Copy link

Can clients be used from multiple goroutines?

Is it recommended to keep an instance of client laying around or just create a new one per batch?

@sideshow
Copy link
Owner

sideshow commented Oct 5, 2016

Thanks for logging this issue.

I will keep this issue open until more docs have been added, but to answer your question in the meantime;

It is safe to use client from multiple go routines. You should keep a client lying round and use the same client.

There is a comment on the method https://github.com/sideshow/apns2/blob/master/client.go#L49, but agree this needs clarifying in the docs.

The connection manager has been added in the last few days. It is designed to be used when you have multiple connections with different certs (ie, you are sending to multiple apps). For sending to one app, just use the client instead of the connection manager.

I will add some more docs in the coming days to better explain.

@sideshow
Copy link
Owner

Closing this as more docs will be added as part of #54

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

2 participants