Split push notification implementation into focused, maintainable files for
better code organization and easier navigation. Each file now has a clear
responsibility and contains related functionality.
File Organization:
1. push_notifications.go (Main API):
- Push notification constants (MOVING, MIGRATING, etc.)
- PushNotificationHandler interface
- PushNotificationProcessorInterface
- Public API wrappers (PushNotificationRegistry, PushNotificationProcessor)
- Main entry point for push notification functionality
2. push_notification_handler_context.go (Context):
- PushNotificationHandlerContext interface
- pushNotificationHandlerContext concrete implementation
- NewPushNotificationHandlerContext constructor
- All context-related functionality with concrete type getters
3. push_notification_processor.go (Core Logic):
- Registry implementation for handler management
- Processor implementation for notification processing
- VoidProcessor implementation for RESP2 connections
- Core processing logic and notification filtering
Benefits:
- Clear separation of concerns between files
- Easier to navigate and maintain codebase
- Focused files with single responsibilities
- Better code organization for large codebase
- Simplified debugging and testing
File Responsibilities:
- Main API: Public interfaces and constants
- Context: Handler context with concrete type access
- Processor: Core processing logic and registry management
All functionality remains intact with improved organization. Tests pass
and compilation succeeds with the new file structure.