timehop / apns

A Go package to interface with the Apple Push Notification Service
https://godoc.org/github.com/timehop/apns
MIT License
185 stars 47 forks source link

What is the lifetime of the client instance? #1

Closed chakrit closed 9 years ago

chakrit commented 10 years ago

As the title says, since I've read from the docs that it might periodically disconnect any idle APN client. Is this managed automatically and we should only create one client? Or should we create new client each time we have a payload to deliver?

Same goes for the feedback loop. Do we just fire one loop? Or do we have to continually fire one as we create new client?

bdotdub commented 9 years ago

Whoa sorry for the late reply! I must have missed the notification for this.

Regarding the apns client, it is supposed to act as a long lived client that you call Send() on whenever you have a payload. It abstracts the connection /reconnection to the Apple gateway.

For the feedback client, it's meant to be something that is created, receives the broken tokens, and then dies. It's meant to be periodically created and run independent of the send client