NewClientManager returns a new ClientManager for prolonged, concurrent usage of multiple APNs clients. ClientManager is flexible enough to work best for your use case. When a client is not found in the manager, Get will return the result of calling Factory, which can be a Client or nil. Having mult
()
| 47 | // By default, MaxSize is 64, MaxAge is 10 minutes, and Factory always returns |
| 48 | // a Client with default options. |
| 49 | func NewClientManager() *ClientManager { |
| 50 | manager := &ClientManager{ |
| 51 | MaxSize: 64, |
| 52 | MaxAge: 10 * time.Minute, |
| 53 | Factory: NewClient, |
| 54 | } |
| 55 | |
| 56 | manager.initInternals() |
| 57 | |
| 58 | return manager |
| 59 | } |
| 60 | |
| 61 | // Add adds a Client to the manager. You can use this to individually configure |
| 62 | // Clients in the manager. |