MCPcopy
hub / github.com/sideshow/apns2 / NewClientManager

Function NewClientManager

client_manager.go:49–59  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

47// By default, MaxSize is 64, MaxAge is 10 minutes, and Factory always returns
48// a Client with default options.
49func 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.

Calls 1

initInternalsMethod · 0.95