setupPushNotifications sets up push notification handling by registering with the client's processor.
()
| 136 | |
| 137 | // setupPushNotifications sets up push notification handling by registering with the client's processor. |
| 138 | func (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. |
| 158 | func (hm *Manager) TrackMovingOperationWithConnID(ctx context.Context, newEndpoint string, deadline time.Time, seqID int64, connID uint64) error { |
no test coverage detected