1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

refactor(push): simplify handler context

This commit is contained in:
Nedyalko Dyakov
2025-07-05 03:11:11 +03:00
parent 84123b1331
commit d78040165a
5 changed files with 200 additions and 353 deletions

View File

@ -555,8 +555,11 @@ func (c *PubSub) processPendingPushNotificationWithReader(ctx context.Context, c
func (c *PubSub) pushNotificationHandlerContext(cn *pool.Conn) push.NotificationHandlerContext {
// PubSub doesn't have a client or connection pool, so we pass nil for those
// PubSub connections are blocking
return push.HandlerContext{}
return push.NewNotificationHandlerContext(nil, nil, c, cn, true)
return push.NotificationHandlerContext{
PubSub: c,
Conn: cn,
IsBlocking: true,
}
}
type ChannelOption func(c *channel)