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

Method setupPushNotifications

maintnotifications/manager.go:138–155  ·  view source on GitHub ↗

setupPushNotifications sets up push notification handling by registering with the client's processor.

()

Source from the content-addressed store, hash-verified

136
137// setupPushNotifications sets up push notification handling by registering with the client's processor.
138func (hm *Manager) setupPushNotifications() error {
139 processor := hm.client.GetPushProcessor()
140 if processor == nil {
141 return ErrInvalidClient // Client doesn't support push notifications
142 }
143
144 // Create our notification handler
145 handler := &NotificationHandler{manager: hm, operationsManager: hm}
146
147 // Register handlers for all upgrade notifications with the client's processor
148 for _, notificationType := range maintenanceNotificationTypes {
149 if err := processor.RegisterHandler(notificationType, handler, true); err != nil {
150 return errors.New(logs.FailedToRegisterHandler(notificationType, err))
151 }
152 }
153
154 return nil
155}
156
157// TrackMovingOperationWithConnID starts a new MOVING operation with a specific connection ID.
158func (hm *Manager) TrackMovingOperationWithConnID(ctx context.Context, newEndpoint string, deadline time.Time, seqID int64, connID uint64) error {

Callers 1

NewManagerFunction · 0.95

Calls 3

FailedToRegisterHandlerFunction · 0.92
GetPushProcessorMethod · 0.65
RegisterHandlerMethod · 0.65

Tested by

no test coverage detected