NewManager creates a new simplified manager.
(client interfaces.ClientInterface, pool pool.Pooler, config *Config)
| 108 | |
| 109 | // NewManager creates a new simplified manager. |
| 110 | func NewManager(client interfaces.ClientInterface, pool pool.Pooler, config *Config) (*Manager, error) { |
| 111 | if client == nil { |
| 112 | return nil, ErrInvalidClient |
| 113 | } |
| 114 | |
| 115 | hm := &Manager{ |
| 116 | client: client, |
| 117 | pool: pool, |
| 118 | options: client.GetOptions(), |
| 119 | config: config.Clone(), |
| 120 | hooks: make([]NotificationHook, 0), |
| 121 | } |
| 122 | |
| 123 | // Set up push notification handling |
| 124 | if err := hm.setupPushNotifications(); err != nil { |
| 125 | return nil, err |
| 126 | } |
| 127 | |
| 128 | return hm, nil |
| 129 | } |
| 130 | |
| 131 | // GetPoolHook creates a pool hook with a custom dialer. |
| 132 | func (hm *Manager) InitPoolHook(baseDialer func(context.Context, string, string) (net.Conn, error)) { |