1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

feat: add general push notification system

- Add PushNotificationRegistry for managing notification handlers
- Add PushNotificationProcessor for processing RESP3 push notifications
- Add client methods for registering push notification handlers
- Add PubSub integration for handling generic push notifications
- Add comprehensive test suite with 100% coverage
- Add push notification demo example

This system allows handling any arbitrary RESP3 push notification
with registered handlers, not just specific notification types.
This commit is contained in:
Nedyalko Dyakov
2025-06-26 20:26:02 +03:00
parent 0decfdc6ed
commit b02eed63b2
6 changed files with 1633 additions and 2 deletions

View File

@ -216,6 +216,17 @@ type Options struct {
// UnstableResp3 enables Unstable mode for Redis Search module with RESP3.
// When unstable mode is enabled, the client will use RESP3 protocol and only be able to use RawResult
UnstableResp3 bool
// PushNotifications enables general push notification processing.
// When enabled, the client will process RESP3 push notifications and
// route them to registered handlers.
//
// default: false
PushNotifications bool
// PushNotificationProcessor is the processor for handling push notifications.
// If nil, a default processor will be created when PushNotifications is enabled.
PushNotificationProcessor *PushNotificationProcessor
}
func (opt *Options) init() {