1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-23 21:01:00 +03:00
Commit Graph

1 Commits

Author SHA1 Message Date
b4d0ff15fb refactor: organize push notification code into separate files
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.
2025-07-04 21:25:51 +03:00