MCPcopy
hub / github.com/redis/go-redis / NewManager

Function NewManager

maintnotifications/manager.go:110–129  ·  view source on GitHub ↗

NewManager creates a new simplified manager.

(client interfaces.ClientInterface, pool pool.Pooler, config *Config)

Source from the content-addressed store, hash-verified

108
109// NewManager creates a new simplified manager.
110func 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.
132func (hm *Manager) InitPoolHook(baseDialer func(context.Context, string, string) (net.Conn, error)) {

Calls 3

GetOptionsMethod · 0.65
CloneMethod · 0.65