mirror of
https://github.com/redis/go-redis.git
synced 2025-10-20 09:52:25 +03:00
feat: RESP3 notifications support & Hitless notifications handling [CAE-1088] & [CAE-1072] (#3418)
- Adds support for handling push notifications with RESP3. - Using this support adds handlers for hitless upgrades. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Hristo Temelski <hristo.temelski@redis.com>
This commit is contained in:
44
push/handler_context.go
Normal file
44
push/handler_context.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package push
|
||||
|
||||
// No imports needed for this file
|
||||
|
||||
// NotificationHandlerContext provides context information about where a push notification was received.
|
||||
// This struct allows handlers to make informed decisions based on the source of the notification
|
||||
// with strongly typed access to different client types using concrete types.
|
||||
type NotificationHandlerContext struct {
|
||||
// Client is the Redis client instance that received the notification.
|
||||
// It is interface to both allow for future expansion and to avoid
|
||||
// circular dependencies. The developer is responsible for type assertion.
|
||||
// It can be one of the following types:
|
||||
// - *redis.baseClient
|
||||
// - *redis.Client
|
||||
// - *redis.ClusterClient
|
||||
// - *redis.Conn
|
||||
Client interface{}
|
||||
|
||||
// ConnPool is the connection pool from which the connection was obtained.
|
||||
// It is interface to both allow for future expansion and to avoid
|
||||
// circular dependencies. The developer is responsible for type assertion.
|
||||
// It can be one of the following types:
|
||||
// - *pool.ConnPool
|
||||
// - *pool.SingleConnPool
|
||||
// - *pool.StickyConnPool
|
||||
ConnPool interface{}
|
||||
|
||||
// PubSub is the PubSub instance that received the notification.
|
||||
// It is interface to both allow for future expansion and to avoid
|
||||
// circular dependencies. The developer is responsible for type assertion.
|
||||
// It can be one of the following types:
|
||||
// - *redis.PubSub
|
||||
PubSub interface{}
|
||||
|
||||
// Conn is the specific connection on which the notification was received.
|
||||
// It is interface to both allow for future expansion and to avoid
|
||||
// circular dependencies. The developer is responsible for type assertion.
|
||||
// It can be one of the following types:
|
||||
// - *pool.Conn
|
||||
Conn interface{}
|
||||
|
||||
// IsBlocking indicates if the notification was received on a blocking connection.
|
||||
IsBlocking bool
|
||||
}
|
Reference in New Issue
Block a user