initializePushProcessor initializes the push notification processor for any client type. This is a shared helper to avoid duplication across NewClient, NewFailoverClient, and NewSentinelClient.
(opt *Options)
| 1472 | // initializePushProcessor initializes the push notification processor for any client type. |
| 1473 | // This is a shared helper to avoid duplication across NewClient, NewFailoverClient, and NewSentinelClient. |
| 1474 | func initializePushProcessor(opt *Options) push.NotificationProcessor { |
| 1475 | // Always use custom processor if provided |
| 1476 | if opt.PushNotificationProcessor != nil { |
| 1477 | return opt.PushNotificationProcessor |
| 1478 | } |
| 1479 | |
| 1480 | // Push notifications are always enabled for RESP3, disabled for RESP2 |
| 1481 | if opt.Protocol == 3 { |
| 1482 | // Create default processor for RESP3 connections |
| 1483 | return NewPushNotificationProcessor() |
| 1484 | } |
| 1485 | |
| 1486 | // Create void processor for RESP2 connections (push notifications not available) |
| 1487 | return NewVoidPushNotificationProcessor() |
| 1488 | } |
| 1489 | |
| 1490 | // RegisterPushNotificationHandler registers a handler for a specific push notification name. |
| 1491 | // Returns an error if a handler is already registered for this push notification name. |
no test coverage detected